Well,
I typedef function pointer as :
typedef string(*t_arr[5])();
and then i create function in class as :
void initStringFunctionPointer(t_arr t_err);
and then i declared as :
void Register::initStringFunctionPointer(t_arr t_err)
{
t_err[0] = &getName;
t_err[1] = &getSurname;
t_err[2] = &getUsername;
t_err[3] = &getPassword;
t_err[4] = &getEmail;
}
but all of lines gives this error :
C:\Qt Projects\base\ClassProject_tmp\goinlib.cpp:20: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say '&Register::getName' [-fpermissive]
t_err[0] = &getName;
^
I don't know what to do, Any ideas ?
Edit :
It worked, static or doing type is succeed, thank you.