Question 6
Back to Exercise
What is strlen("hello")?
- A 6
- B 5 Correct
- C 4
- D It depends on the array size
Correct Answer: Option B
strlen counts characters before '\0'. Storing the string needs strlen + 1 bytes; sizeof "hello" is 6.
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!