Question 6
Back to Exercise
How should a char argument be read with va_arg?
- A va_arg(ap, char)
- B va_arg(ap, char *)
- C (char) va_arg(ap, int) Correct
- D va_arg(ap, short)
Correct Answer: Option C
char (and short and bool) are promoted to int, so read an int and convert it back if needed.
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!