How can we collect the address of a function in C++ into a function pointer? Please help me modify the following code so as to collect the address of display() in p.
Code:#include<iostream.h> class ex { int i,j; public: ex(int ii,int jj) { i=ii;j=jj; } ex() { i=0; } display() { cout<<i<<endl<<endl; } }; void main() { ex e(1,2); void (*p)(); p=&(e.display()); cout<<e.display()<<endl<<p<<endl; }