#include <iostream>
using namespace std;
void print()
{
cout << "print" << endl;
}
string get(int i, int j)
{
cout << "get " << i << " and " << j << " string" << endl;
string result = "get i j";
return result;
}
int main()
{
typedef void(*voidFuncPtr)();
int* p = (int*)&print;
voidFuncPtr pfn = &print;
(*((voidFuncPtr)p))();
pfn();
typedef string(*getFun)(int, int);
getFun g = &get;
string result = g(10, 20);
cout << result.c_str() << endl;
return 0;
}
using namespace std;
void print()
{
cout << "print" << endl;
}
string get(int i, int j)
{
cout << "get " << i << " and " << j << " string" << endl;
string result = "get i j";
return result;
}
int main()
{
typedef void(*voidFuncPtr)();
int* p = (int*)&print;
voidFuncPtr pfn = &print;
(*((voidFuncPtr)p))();
pfn();
typedef string(*getFun)(int, int);
getFun g = &get;
string result = g(10, 20);
cout << result.c_str() << endl;
return 0;
}