Pointers to member funtctions

From: sss (xxx_at_xxx.edu)
Date: 03/29/05


Date: Mon, 28 Mar 2005 14:25:05 -0800

Consider the followning.
int main(){
  int (*move)();
  int (*mve)(int);
  int temp();
  int temp(int);

  move = temp;
  move = &temp;

  mve = temp;
  mve = &temp;
}

The compiler does not seem to have any complaints on the above lines.
But when I change the everything to being part of a class it no longer
works.

class xxxx{
  int (*move)();
  int (*mve)(int);
  int temp();
  int temp(int);
  xxxx();
};

xxxx::xxxx(){
  move = temp;
  move = &temp;

  mve = temp;
  mve = &temp;
}

Anybody know why the second approach does not work.