Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!ihnp4!cord!gwr From: gwr@cord.UUCP (GW Ryan) Newsgroups: comp.lang.c++ Subject: Re: possible bugs Keywords: typedef, stream.h, pointer-to-function parameters Message-ID: <552@cord.UUCP> Date: 1 Apr 88 03:14:09 GMT References: <6112@watdragon.waterloo.edu> Reply-To: gwr@cord.UUCP (59451-GW Ryan) Distribution: na Organization: AT&T Bell Laboratories, Liberty Corner Lines: 32 In article <6112@watdragon.waterloo.edu> gjditchfield@violet.UUCP writes: both your cases 1 and 2 work fine in 1.2.3 cfront >3) This is more likely to be my misunderstanding than a bug. The syntax in > the back of "The C++ Programming Language" suggests that functions can > have pointer-to-function parameters, but I get (uninformative) error > messages unless I use a typedef. > ---------------------------------------- > typedef int (*PFCCI)(char, char); // ptr to fn mapping 2 chars to int. > > void f( PFCCI p); > > void g( int (*p)(char, char) ); > ---------------------------------------- > ccc pmf.cc: > "pmf.c", line 5: error: syntax error > "pmf.cc", line 5: error: syntax error > "pmf.cc", line 5: error: syntax error > ---------------------------------------- i don't understand what you are trying to do here. g() is supposed to be a function taking what parameters??? are you trying to say g takes one arg, which is the result of a call to what a PFCCI points at? If so, declare it void g(int); are you trying to pass a function pointer AND the 2 chars to run it on? void g(PFCCI, char, char); i don't think you can explicitly look for calls to g() where the arg is a call to a PFCCI function jerry ryan