What is wrong with the following code excerpt? int errno=0; if(close(fd)==-1) {perror("close error");} Select one: a. The condition will always be either true or false, so the if statement is not needed. b. The function close expects a FILE *, not a file descriptor. c. Errno is declared automatically, so you shouldn't declare it. d. The function perror should not be used because it is not safe from rentrancy.
Added by Colleen L.
Close
Step 1
The variable "closefa" is not declared or initialized before being used in the if statement. This will result in a compilation error. Show more…
Show all steps
Your feedback will help us improve your experience
Narayan Hari and 99 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Improve the Mad Lib game from Chapter 5, "Functions: Mad Lib," by using references to make the program more efficient. What's wrong with the following program? int main() { int score; score = 1000; float& rScore = score; return 0; } 3. What's wrong with the following function? int& plusThree(int number) { int threeMove = number + 3; return threeMove; }
Supreeta N.
Explain what is wrong with the statement. If $f(x, y)$ has a local maximum value of 1 at the origin, then the global maximum is 1.
Optimization: Local and Global Extrema
Optimization
What will be the output of the following program? (A) overflow error (B) syntax error (C) returns 0 (D) returns 1
Programming and Data Structures
Functions
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD