home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16187 < prev    next >
Encoding:
Text File  |  1992-11-12  |  873 b   |  33 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!walter!att-out!pacbell.com!ames!sun-barr!cs.utexas.edu!convex!news.utdallas.edu!corpgate!crchh327!bnr.ca!grier
  3. From: grier@bnr.ca (Brian Grier)
  4. Subject: Re: Bad 'for' statement?
  5. Message-ID: <1992Nov12.204749.24548@bnr.ca>
  6. Sender: news@bnr.ca (News on crchh327)
  7. Nntp-Posting-Host: 131.253.206.80
  8. Organization: Bell Northern Research
  9. Date: Thu, 12 Nov 1992 20:47:49 GMT
  10. Lines: 21
  11.  
  12. > Hi,
  13.  
  14. > Could you tell me if this is really a syntax error as AT&T 2.1 reports?
  15.  
  16. >   for(int i=0, int j=10;   i<10;   i++, j++)
  17. >   {
  18. >     // do something
  19. >   }
  20. > Thanks,
  21.  
  22. > Guy
  23.  
  24. I tried this on g++, and HP cc both gives an unexpected symbol: "int" error.
  25. I tried the HP compiler in both K&R and ANSI modes
  26.  
  27. I suggest moving the declarations out of the 'for'statement.
  28.  
  29. Brian, WS1S
  30. Bell Northern Research
  31. Research Triangle Park, NC
  32. bjgrier@bnr.ca
  33.