Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!unido!orthogo!basti From: basti@orthogo.UUCP (Sebastian Wangnick) Newsgroups: comp.lang.c++ Subject: Re: Pointer to function Message-ID: <814@orthogo.UUCP> Date: 18 Oct 90 09:26:48 GMT References: <3194@s3.ireq.hydro.qc.ca> Organization: none Lines: 26 robert@ireq.hydro.qc.ca (R.Meunier 8516) writes: > I'm trying to implement a stack objet with ptr to function >as members. But i can't go through the compiler (SUN C++) Use the first example. Use typedef void (*ProcVoid) (void*) and cast to it: >main() >{ >int aa=10; >float bb=100; >void foo1(int *); >void foo2(float *); >ST a(&aa,ProcVoid(foo1)); >ST b(&bb,ProcVoid(foo2)); > a.exec(); > a.exec(); >} Hope that works, Sebastian Wangnick (basti@orthogo.uucp)