delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/18/10:00:44

From: Weiqi Gao <weiqigao AT a DOT crl DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 2 Questions!
Date: Sun, 18 Jul 1999 08:21:31 -0500
Organization: CRL Network Services
Lines: 26
Message-ID: <3791D4DB.190A8B15@a.crl.com>
References: <7msim9$die$1 AT nnrp01 DOT ops DOT uunet DOT co DOT za>
NNTP-Posting-Host: a116019.stl1.as.crl.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.36 i586)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Burger Rule wrote:
> 
> 1) In this code:
> 
>   for (i=1, i<10, i=i+1)
> 
> The error message I get from this is -> "Error: parse error before ' ) ' ".

The compiler is looking for the
  for ( <expression>_optional ; <expr>_opt ; <expr>_opt ) <statement>
construction as specified by the ANSI C grammar once it sees the "for".

In C, "i = 1, i < 10, i = i + 1" counts as ONE expression.  The compiler
is looking the the first semi-colon after this expression when it sees
the ')'.

> 2:) Based on your experience with different books you studied to learn and
> to become a expert in C++, what would you recommend for a beginner as a
> really excellent book on teaching C++.

[1] Stanley B. Lippman & Josee Lajoie, C++ Primer, 3rd ed.,
Addison-Wesley, Reading, Massachusetts, 1998

-- 
Weiqi Gao
weiqigao AT a DOT crl DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019