CJCoding With Joseph
← Back to Question List
C++ Code Walkthrough #45

Function Overload Resolution

hardFunctions

📄 Code

Read carefully — what does this print?
1#include <iostream>
2using namespace std;
3void f(int x) { cout << "int " << x << endl; }
4void f(double x) { cout << "double " << x << endl; }
5int main() {
6 f(5);
7 f(5.0);
8 f('A');
9 return 0;
10}

🎯 Your Answer