Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!snorkelwacker!mit-eddie!rutgers!cmcl2!yale!cs.yale.edu!starr-page From: starr-page@CS.Yale.EDU (Page Starr) Newsgroups: comp.lang.c++ Subject: Function pointers Message-ID: <3601@cs.yale.edu> Date: 26 Oct 89 15:14:13 GMT Sender: news@cs.yale.edu Reply-To: starr-page@CS.Yale.EDU (Page Starr) Organization: Yale University Computer Science Dept, New Haven CT 06520-2158 Lines: 38 Why does the following code fragment compile (under CC and G++(1.36.0-)) typedef int (*pfi)(); main() { pfi c; } as well as int (*pfi)(); main() { } But the following does not (syntax error) main() { int (*pfi)(); } and neither does the following... main() { int (::*pfi)(); } typedef seems to get around the problem (can typedef in main() OK as well), but shouldn't be necessary... ----------------------------------------------------------------------------- What will you say to the Revolutionary Committee, when it assumes power? ----------------------------------------------------------------------------- CSnet: starr@cs.yale.edu BITNET: starr@yalecs.BITNET ARPAnet: starr%cs.yale.edu@relay.cs.net Phone: (203)432-1215 USmail: Page Starr, Box 2158 Yale Station, New Haven, CT 06520