Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!rutgers!bellcore!faline!thumper!ulysses!andante!alice!ark From: ark@alice.UUCP Newsgroups: comp.lang.c++ Subject: Re: Functions taking function parameters Message-ID: <7974@alice.UUCP> Date: 12 Jun 88 14:10:18 GMT References: <839@mmm.UUCP> <1340@crete.cs.glasgow.ac.uk> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 37 In article <1340@crete.cs.glasgow.ac.uk>, orr@glasgow.UUCP writes: > class List { > SomeType Data [ SomeSize ] ; > public: > . > . > . > void Iterator ( void fn ( SomeType ) ) ; > end ; > > the line `void Iterator ( void fn ( SomeType ) ) ;' gives a syntax error. First of all, I presume you meant to say }; instead of end; Either that or you have some nasty preprocessor macros. Anyway, your problem is a long standing bug in cfront. This bug is extremely hard to fix. Nevertheless, I believe it will be fixed in a future release of cfront. THe way to circumvent it is to use typedef: typedef void void_func_SomeType (SomeType); // . . . void iterator (void_func_sometype* fn); Don't forget the * -- you can't pass functions as arguments, only pointers to functions.