#include <iostream>
usingnamespace std;
class a
{
public:
void function(){ cout << "hi" << endl; }
void functionTimesTwo(){ cout << "hello" << endl; }
void functionDivideByTwo(){ cout << "hallo" << endl; }
};
typedefvoid a::(*IntFunctionWithOneParameter) ();
int main()
{
a obj;
IntFunctionWithOneParameter functions[] =
{
obj.function,
obj.functionTimesTwo,
obj.functionDivideByTwo
};
for(int i = 0; i < 3; ++i)
{
functions[i]();
}
system("PAUSE");
}
/*
This is part of my project, i am just running a sample problem so i get the right syntax
ERRORS
11 C:\Users\minahnoona\Desktop\hgf.cpp typedef name may not be a nested-name-specifier
11 C:\Users\minahnoona\Desktop\hgf.cpp typedef `<anonymous>' is initialized (use __typeof__ instead)
11 C:\Users\minahnoona\Desktop\hgf.cpp confused by earlier errors, bailing out
*/