function pointer

two things I did'nt get till now
Q->1 what is the actual use of function pointer ?
Q->2 what is use of passing function as an argument to another function ?
Q->1 what is the actual use of function pointer ?

Implementation-defined, but normally the same as the size of a pointer to object.

1
2
3
4
5
#include <iostream>
int main()
{
   std::cout << sizeof(void(*)()) << '\n';
}

I get 8 (on 64-bit platform)

Now the size of a member function pointer is another story...
Topic archived. No new replies allowed.