Question 1
Back to Exercise
Which line is a function declaration but not a definition?
- A int max(int a, int b) { return a > b ? a : b; }
- B int max(int a, int b); Correct
- C max(3, 4);
- D auto m = max;
Correct Answer: Option B
A declaration ends with a semicolon instead of a body. It tells the compiler how to call the function; the definition can come later or in another file.
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!