#include <iostream>
// Setup the same function name 3 times
// with 3 different parameters
void MyFunction();
void MyFunction(int);
void MyFunction(int, int);
int main()
{
MyFunction(); // This will call the 1st one
MyFunction(2); // This will call the 2nd one
MyFunction(2, 3); // This will call the 3rd one
return 0;
}
void MyFunction() // First
{
std::cout << "You called the first version of MyFunction()" << std::endl;
}
void MyFunction(int i) // Second
{
std::cout << "You called the second version of MyFunction()" << std::endl;
}
void MyFunction(int i, int j) // Third
{
std::cout << "You called the third version of MyFunction()" << std::endl;
}