Question 5
Back to Exercise
What does strcmp(s1, s2) return when s1 comes before s2?
- A -1 exactly
- B A negative value (any negative int) Correct
- C 0
- D false
Correct Answer: Option B
The standard only promises the sign. Test strcmp(a, b) < 0, never == -1.
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!