Yes, it is possible with function pointers.




#include <iostream>
using namespace std;

void foo(int x)
{