Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.lang.c Subject: Re: `interesting' program Message-ID: <660042@hpclscu.HP.COM> Date: 10 Jul 89 22:39:10 GMT References: <2833@solo8.cs.vu.nl> Organization: Hewlett-Packard Calif. Language Lab Lines: 22 > IMHO 2) is the winner! ISEHO 3) is right. > > I say: zork() is a constant of type struct foo, so you cannot take its > address and it isn't an lvalue. > SE says: zork() is the name of a struct foo, so you CAN take its address. You're right, the SE is wrong. zork() is not exactly a "constant", but it is an expression of type struct foo. However, it is *not* an lvalue so you cannot take its address. Since it is a structure expression, you can select a member (you do not have to have an lvalue to do a member selection, even though many compilers prevent you from selecting a member from a non-lvalue struct). Try this expression on for size: struct foo func1(), func2(); int i; (i ? func1() : func2()).mids; ---- Shankar Unni. Hewlett-Packard California Language Lab.