Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!santra!santra!ahuttune From: ahuttune@niksula.hut.fi (Ari Juhani Huttunen) Newsgroups: comp.lang.c++ Subject: Pointers to member-functions, what's wrong? Message-ID: Date: 14 Oct 90 17:55:28 GMT Sender: news@santra.uucp (Cnews - USENET news system) Distribution: comp Organization: Helsinki University of Technology, Finland Lines: 22 In short, how do I make this work? What's wrong? The idea is easy to understand, but I think Turbo-C++ doesn't like me... ;-) #include class c { public: void f1() { cout << "Function 1...\n"; } void f2() { cout << "Function 2...\n"; } void dispatch( void (*func)() ) { (*this.*func)(); } }; main() { c x; x.dispatch(c::f1); x.dispatch(c::f2); } -- ___ ___ ___ ___ ___ ___ ___ ___ ___ __I I__I I__I I__I I__I I__I I__I I__I I__I I Thank you Ari Huttunen (ahuttune@niksula.hut.fi) I for not smoking! ____________________________________________I