Write two overloaded functions with the same name but different parameter types:
void foo(int x); void foo(int* p);
The goal is to demonstrate how overload resolution behaves differently for integer literals and nullptr in modern C++.
nullptr
The program will explicitly call:
foo(0); foo(nullptr);
You only need to implement the two overloads so that each prints which overload was selected.
foo(int)
int overload
foo(int*)
int* overload
Example Output:
int overload int* overload
Test Cases
Test Results
Input
Expected Output