Xref: utzoo comp.sys.amiga.tech:14764 comp.sys.amiga:67486 comp.sys.amiga.hardware:3811 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!agate!pasteur!danube.Berkeley.EDU!c150-ec From: c150-ec@danube.Berkeley.EDU (Johnson Sieu) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga,comp.sys.amiga.hardware Subject: help: C++ Keywords: help C++ Message-ID: <28364@pasteur.Berkeley.EDU> Date: 1 Oct 90 06:23:39 GMT References: <26ed022f-8f5comp.sys.amiga.tech@tronsbox.xei.com> <980@iceman.jcu.oz> Sender: news@pasteur.Berkeley.EDU Reply-To: c150-ec@danube.Berkeley.EDU.UUCP (Johnson Sieu) Organization: UC Berkeley Experimental Computing Facility (XCF) Lines: 28 I wanted to define a function that accepts a function pointer in C++ and the compiler complained. My program is as follows: void foo () { } void foobar(void (*func)()) { void (*temp_func)(); temp_func = func; } int main() { foobar(&foo); } The compiler doesn't seem to accept my argument declaration for func! I compiled it under Lattice C and everything is fine. What is the problem then? Could any experienced C++ programmer please help me to see the light. Johnson email: c150-ec@danube.berkeley.edu