Question 18
Back to Exercise
Why do C++ compilers mangle function names?
- A To hide source code
- B To encode parameter types in the symbol so overloaded functions get distinct names for the linker Correct
- C To make programs smaller
- D To support recursion
Correct Answer: Option B
add(int, int) and add(double, double) become different linker symbols. extern "C" disables mangling so C code can call the function.
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!