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

  1. Path: sparky!uunet!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What is meant by: double A[n,m]?
  5. Message-ID: <1992Nov20.102416.21231@thunder.mcrcim.mcgill.edu>
  6. Date: 20 Nov 92 10:24:16 GMT
  7. References: <TORSTEIN.92Nov18125146@itekiris.kjemi.unit.no> <1992Nov18.223900.8941@kpc.com>
  8. Organization: McGill Research Centre for Intelligent Machines
  9. Lines: 24
  10.  
  11. In article <1992Nov18.223900.8941@kpc.com>, hollasch@kpc.com (Steve Hollasch) writes:
  12. > torstein@itekiris.kjemi.unit.no (torstein hansen) writes:
  13. >> double A[n,m];
  14. > jlothian@castle.ed.ac.uk (J Lothian) writes:
  15. >> I suspect that's exactly what's happening.  The comma operator
  16. >> [...].  Presumably your C compiler is quite happy to do this
  17. >> evaluation at compile-time, [...].
  18. > Not true.  First of all, the expression "A[index]" is not evaluated
  19. > at compile time,
  20.  
  21. In the original posting, it wasn't an expression, and the stuff in the
  22. [] was necessarily evaluated at compile-time because it was an array
  23. size in a declaration.
  24.  
  25. As for meaningless, it's not meaningless, no.  But the comma operator
  26. is not one of the operators allowed in compile-time constant
  27. expressions such as must be used to specify array sizes, so it's not
  28. really a legal declaration, though apparently at least one compiler
  29. accepts it anyway.
  30.  
  31.                     der Mouse
  32.  
  33.                 mouse@larry.mcrcim.mcgill.edu
  34.