Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: procedure pointer question Message-ID: <10198@mimsy.UUCP> Date: 15 Jan 88 17:35:01 GMT References: <861@xn.LL.MIT.EDU> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 16 In article <861@xn.LL.MIT.EDU> cogen@XN.LL.MIT.EDU (David Cogen) writes: - double sin (); - double (*fun) (); - - fun = sin; - printf ("%f %f", fun(1), (*fun)(1)); - -Both invocations of fun work and give the correct result. But it seems that one -of the invocations is wrong (the first). Why do they both work? The first one is not allowed by K&R, but is allowed by the dpANS. The first invocation works because PCC lets it work. (And what the compiler does defines the language :-) ... well, this time.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris