Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: >< swap operator Date: Mon, 08 Oct 2018 08:36:28 -0700 Organization: None to speak of Lines: 37 Message-ID: References: <36d546c5-b471-45fc-b87a-8ebebdc0c0b7@googlegroups.com> <9d5c4ae9-47ef-4da0-9b39-e7dbc96ab1be@googlegroups.com> <87va6gjile.fsf@bsb.me.uk> <87d0snkcs4.fsf@bsb.me.uk> <87o9c6j4fl.fsf@bsb.me.uk> <87pnwlhp1q.fsf@bsb.me.uk> <3d46f51b-bfcf-4966-8528-aa586e5e0cdb@googlegroups.com> <87zhvpfbob.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="044f0ceb07b55f0a559303158e3458ae"; logging-data="19960"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QM1YU5PYDJS/wklwAVYl+" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:J8hd2dhxuBnndZ230SmRr8qZDIU= sha1:iiCFWPxmoLx9GTJXoZtBXlLAi0g= Xref: csiph.com comp.lang.c:136427 Bart writes: [...] > So if I take the expression "a[i+1]" which I can use like this inside > the argument list here: > > f(a[i+1]); > > you say I can't take the same expression and write it as a standalone > statement like this: > > a[i+1]; > > Even though, actually, I can. This will be my last attempt to explain this to you. I'm almost certainly wasting my time. To avoid any confusion, I'm using `...` to separate C code from English text. `a[i+1]` is an expression. It is not, and cannot be, a statement. `a[i+1];` is a statement. It is not, and cannot be, an expression. You cannot use `a[i+1]` as a statement. You can turn it into a statement by adding a semicolon. It is the semicolon that makes the difference, your insistence on minimizing it or ignoring it notwithstanding. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"