F
Frederick Dean
Hi, guys!
Please look at the very simple code below:
//---------------code begin------------------------
void f()
{
cout << "f function " << endl;
}
void (*pf)() = &f;
int main()
{
int *p;
pf();
(*pf)();
cout << std::hex << *pf << endl;
cout << pf << endl;
cout << **pf << endl; // also works, oh....
cout << *******pf << endl; // also works, Weird.
(*************pf)(); // also works in most compilers, why??
return 0;
}
//----------------code end---------------------------
I wonder why (**********pf)() still works? Even any number of '*'
before pf will work too.
Any help is appreciated!
Thanks!
Please look at the very simple code below:
//---------------code begin------------------------
void f()
{
cout << "f function " << endl;
}
void (*pf)() = &f;
int main()
{
int *p;
pf();
(*pf)();
cout << std::hex << *pf << endl;
cout << pf << endl;
cout << **pf << endl; // also works, oh....
cout << *******pf << endl; // also works, Weird.
(*************pf)(); // also works in most compilers, why??
return 0;
}
//----------------code end---------------------------
I wonder why (**********pf)() still works? Even any number of '*'
before pf will work too.
Any help is appreciated!
Thanks!