Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!rex!ukma!vlsi!ulkyvx.bitnet!laleak01 From: laleak01@ulkyvx.bitnet Newsgroups: comp.lang.c++ Subject: What good are method pointers? Message-ID: <1991Jun30.024124.649@ulkyvx.bitnet> Date: 30 Jun 91 06:41:24 GMT Article-I.D.: ulkyvx.1991Jun30.024124.649 Organization: University of Louisville Lines: 29 What can you do with pointers to methods? Why does this fail?: class Ack { public: void Func (void) { printf ("Ack. Thppft.\n"); } }; void main (void) { Ack ack; void (Ack::*p) (void); p=Ack::Func; // no prob here ack.Func(); // string is output #if 0 p(); // this complains: "too few parms; need 'this'" #else p(ack); // so I gave it a this. #endif } p(ack) produces NO output. I would at least expect it to print "Ack..." What can you really do with pointers to methods? -- Arlie Davis, borrowing Linda's account. (Do not email address.)