home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16730 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.1 KB  |  39 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!portal!dfuller
  3. From: dfuller@portal.hq.videocart.com (Dave Fuller)
  4. Subject: Re: What is meant by: double A[n,m]?
  5. Message-ID: <BxwyI4.FnB@portal.hq.videocart.com>
  6. Organization: VideOcart Inc.
  7. X-Newsreader: Tin 1.1 PL3
  8. References: <TORSTEIN.92Nov18125146@itekiris.kjemi.unit.no>
  9. Date: Wed, 18 Nov 1992 13:22:51 GMT
  10. Lines: 27
  11.  
  12. torstein@itekiris.kjemi.unit.no (torstein hansen) writes:
  13. :   double A[2,2];  
  14. : gave same result as 
  15. :   double A[2];
  16. : gave same result as
  17. :   A[1,1] = some_value;
  18. : and 
  19. :   A[1] = some_value;
  20. : Can somebody enlighten me in this matter?  I couldn't find anything
  21. : about it in any of the C books I have.  If double A[n,m] is illegal,
  22. : shouldn't I get a warning at least?
  23. : Has it something to do with the comma operator, discarding the first
  24. : value inside the braces?
  25.  
  26.   The comma, isn't it great. what is happening is a result of the way the      
  27. comma operator works. It doesn't discard anything, but it does actually
  28. give a return value. The value is the operand on the right side of the
  29. comma. A[1,2] would be same as A[2] in other words.
  30.  
  31.  
  32. Dave Fuller
  33. dfuller@portal.hq.videocart.com
  34.  
  35.