home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16736 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  1.4 KB

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