Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!ucsd!orion!ics.uci.edu!nagel From: nagel@ics.uci.edu (Mark Nagel) Newsgroups: comp.sys.mac.programmer Subject: Re: Arrays of functions in THINK C Keywords: Why does this not work? Message-ID: <924@orion.cf.uci.edu> Date: 3 Aug 88 06:04:37 GMT References: <2884@mit-amt.MEDIA.MIT.EDU> <9651@dartvax.Dartmouth.EDU> Sender: news@orion.cf.uci.edu Reply-To: nagel@ics.uci.edu (Mark Nagel) Organization: University of California, Irvine - Dept. of ICS Lines: 23 In article <9651@dartvax.Dartmouth.EDU> earleh@eleazar.dartmouth.edu (Earle R. Horton) writes: |In article <2884@mit-amt.MEDIA.MIT.EDU> phil@mit-amt.MEDIA.MIT.EDU (Phil Sohn) writes: [ stuff about how gensub[x]() doesn't work in LSC ] | |Try | |(* gensub[1])(); | |I don't think it's a bug in Think. I think Think is handling the |situation properly. In the first form, you are attempting to call a |pointer to a function. In the second form, you are calling the |function referenced by the pointer. The reason the first form works |on "Vaxes, HPs, Suns, and in MPW" is rather obvious: "What else could |I possibly mean here?" K&R doesn't say anything about it. Anybody |care to eleaborate about what ANSI says? I'm relatively sure that ANSI says that if fp is a function pointer then both (*fp)() and fp() are equivalent. -- Mark D. Nagel Department of Information and Computer Science, UC Irvine nagel@ics.uci.edu (ARPA) When they ship styrofoam... {sdcsvax|ucbvax}!ucivax!nagel (UUCP) ...what do they pack it in?