No, it would be:
traverse(&display);
It could be either one. Since the only two things you can do with a function are call it and take its address, if you aren't calling it then C++ assumes you're taking its address. So the & to return its address isn't required.
anyway, traverse(), as well as, display() are member functions of the class and i can't seem to get the proper notation for (display) b/c it says display is undeclared undentifier
Pointers to members have different syntax
Code:
#include <iostream>
using namespace std;
class T {
public:
void speak(int);
};
void T::speak(int num)
{
cout<< num <<endl;
}
typedef void (T::*FunctionPtr)(int);
int main()
{
T t;
FunctionPtr p = &T::speak;
for (int i = 0; i < 5; i++)
(t.*p)(i);
}