Question 4
Back to Exercise
What is the difference between perror() and strerror()?
- A perror prints a message for the current errno to stderr; strerror returns the message text for an error number Correct
- B None
- C perror returns a string; strerror prints it
- D strerror exits the program
Correct Answer: Option A
perror("config") → "config: No such file or directory" on stderr. strerror lets you put the text into your own message or log.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!