home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!walter!att-out!pacbell.com!ames!sun-barr!cs.utexas.edu!convex!news.utdallas.edu!corpgate!crchh327!bnr.ca!grier
- From: grier@bnr.ca (Brian Grier)
- Subject: Re: Bad 'for' statement?
- Message-ID: <1992Nov12.204749.24548@bnr.ca>
- Sender: news@bnr.ca (News on crchh327)
- Nntp-Posting-Host: 131.253.206.80
- Organization: Bell Northern Research
- Date: Thu, 12 Nov 1992 20:47:49 GMT
- Lines: 21
-
- > Hi,
-
- > Could you tell me if this is really a syntax error as AT&T 2.1 reports?
-
- > for(int i=0, int j=10; i<10; i++, j++)
- > {
- > // do something
- > }
- > Thanks,
-
- > Guy
-
- I tried this on g++, and HP cc both gives an unexpected symbol: "int" error.
- I tried the HP compiler in both K&R and ANSI modes
-
- I suggest moving the declarations out of the 'for'statement.
-
- Brian, WS1S
- Bell Northern Research
- Research Triangle Park, NC
- bjgrier@bnr.ca
-