🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #5474

Re: help: C++

#5474
From: Dave Haynie
Date: Tue, 02 Oct 1990 18:39
31 lines
1527 bytes
In article <28364@pasteur.Berkeley.EDU> c150-ec@danube.Berkeley.EDU.UUCP (Johnson Sieu) writes:

>   I wanted to define a function that accepts a function pointer in C++
>   and the compiler complained.  [..program deleted.. ]

>   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.  

In C++, you need a typedef for a function pointer type to be passed around.
In your case, if you did something like:

	typedef	void *voidfunptr(void);

then you could legally do things like:

	void thing(voidfuncptr A) {
	    voidfuncptr B = A;

	    // .....
	}

Etc. and so forth.

>   Johnson

-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
	Standing on the shoulders of giants leaves me cold	-REM
Technical Details
Message-ID: <14812@cbmvax.commodore.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!rutgers!cbmvax!daveh
References: <26ed022f-8f5comp.sys.amiga.tech@tronsbox.xei.com> <980@iceman.jcu.oz> <28364@pasteur.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!rutgers!cbmvax!daveh
From: daveh@cbmvax.commodore.com (Dave Haynie)
Newsgroups: comp.sys.amiga.tech,comp.sys.amiga
Subject: Re: help: C++
Keywords: help C++
Message-ID: <14812@cbmvax.commodore.com>
Date: 2 Oct 90 18:39:44 GMT
References: <26ed022f-8f5comp.sys.amiga.tech@tronsbox.xei.com> <980@iceman.jcu.oz> <28364@pasteur.Berkeley.EDU>
Reply-To: daveh@cbmvax.commodore.com (Dave Haynie)
Organization: Commodore, West Chester, PA
Lines: 31