home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!agate!doc.ic.ac.uk!uknet!edcastle!castle.ed.ac.uk!jlothian
- From: jlothian@castle.ed.ac.uk (J Lothian)
- Newsgroups: comp.lang.c
- Subject: Re: What is meant by: double A[n,m]?
- Message-ID: <28363@castle.ed.ac.uk>
- Date: 18 Nov 92 20:13:41 GMT
- References: <TORSTEIN.92Nov18125146@itekiris.kjemi.unit.no>
- Sender: nntpusr@castle.ed.ac.uk
- Organization: Edinburgh University Computing Service
- Lines: 25
-
- In article <TORSTEIN.92Nov18125146@itekiris.kjemi.unit.no>, torstein@itekiris.kjemi.unit.no (torstein hansen) writes:
- |> As a newcomer to C, previously programming in Pascal, I used the
- |> following declaration in one of my programs:
- |>
- |> double A[n,m];
- [...]
-
- |> Has it something to do with the comma operator, discarding the first
- |> value inside the braces?
-
- I suspect that's exactly what's happening. The comma operator
- evaluates both its arguments, returning the value of the right-
- hand expression and throwing away the value of the left-hand one.
- Presumably your C compiler is quite happy to do this evaluation
- at compile-time, though I'm a little surprised that it didn't flag
- this as an error, given that in this context the construction is
- bound to be meaningless.
-
- James
-
- --
-
- -------------------------------------------------------
- James Lothian | "It's life, Jim,
- james@uk.ac.ed.caad | but not as we know it"
-