Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!ukc!warwick!geoff From: geoff@cs.warwick.ac.uk (Geoff Rimmer) Newsgroups: comp.lang.c Subject: Re: When is a statement an expression? Message-ID: <1795@ubu.warwick.UUCP> Date: 29 Apr 89 08:04:55 GMT References: <1043@itivax.iti.org> <2208@pur-phy> Sender: news@warwick.UUCP Organization: Computer Science, Warwick University, UK Lines: 30 In-reply-to: sho@pur-phy's message of 27 Apr 89 22:17:01 GMT In article <2208@pur-phy> sho@pur-phy (Sho Kuwamoto) writes: > In article <1043@itivax.iti.org> scs@vax3.iti.org (Steve Simmons) writes: > < a = if ( a == 1 ) > < 12 ; > < else > < 14 ; > > 2) "12;" cannot be executed. It is not a legal expression. '12' is an expression. '12;' is a statement. Anything that is a valid expression (such as '12') can always be made into a valid statement by adding a ';'. OK, so it might not *do* anything to have a statement "12;" but it is syntactically correct C. > -Sho Geoff /---------------------------------------------------------------\ | GEOFF RIMMER - Friend of fax booths, ANSI C, PCBH, | | phone *numbers* & MPFC & printf | | email : geoff@uk.ac.warwick.emerald | | address : Computer Science Dept, Warwick University, | | Coventry, England. | | PHONE : +44 203 692320 (10 lines) If I'm out please | | leave a message with my secretary. | | FAX : +44 865 726753 | \---------------------------------------------------------------/