home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!portal!dfuller
- From: dfuller@portal.hq.videocart.com (Dave Fuller)
- Subject: Re: What is meant by: double A[n,m]?
- Message-ID: <BxwyI4.FnB@portal.hq.videocart.com>
- Organization: VideOcart Inc.
- X-Newsreader: Tin 1.1 PL3
- References: <TORSTEIN.92Nov18125146@itekiris.kjemi.unit.no>
- Date: Wed, 18 Nov 1992 13:22:51 GMT
- Lines: 27
-
- torstein@itekiris.kjemi.unit.no (torstein hansen) writes:
- : double A[2,2];
- : gave same result as
- : double A[2];
- :
- : gave same result as
- : A[1,1] = some_value;
- : and
- : A[1] = some_value;
- :
- : Can somebody enlighten me in this matter? I couldn't find anything
- : about it in any of the C books I have. If double A[n,m] is illegal,
- : shouldn't I get a warning at least?
- :
- : Has it something to do with the comma operator, discarding the first
- : value inside the braces?
- :
-
- The comma, isn't it great. what is happening is a result of the way the
- comma operator works. It doesn't discard anything, but it does actually
- give a return value. The value is the operand on the right side of the
- comma. A[1,2] would be same as A[2] in other words.
-
-
- Dave Fuller
- dfuller@portal.hq.videocart.com
-
-