delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/20/18:36:53

From: boyer AT cs DOT sc DOT edu (Daniel Boyer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: for loop problem
Date: Mon, 20 Jan 1997 17:30:13 GMT
Organization: University of South Carolina - Columbia - Computer Science
Lines: 33
Message-ID: <32e3ab54.51656797@redwood.cs.sc.edu>
References: <Pine DOT GSO DOT 3 DOT 95 DOT 970119021703 DOT 3673A-100000 AT hops DOT cs DOT jhu DOT edu>
NNTP-Posting-Host: poplar.cs.sc.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sun, 19 Jan 1997 07:19:01 GMT, Michael Phelps
<morphine AT hops DOT cs DOT jhu DOT edu> wrote:

>On Sat, 18 Jan 1997, Daniel Boyer wrote:
>
>> Ok, can somebody please tell me what is wrong with this line of code:
>> 
>> 	for(char SIX = 'a'; SIX < '}'; SIX++)
>
>It looks like you're trying to declare a variable within the for
>statement.  Change the file extension to ".cc" and compile it with gxx to
>use C++, which allows such constructs.  I don't think C allows this
>(though I could be wrong, and I know it _does_ allow declaring variables
>within a "block").
>

But that is the problem...the filename is allwords.cc and is being
compiled in C++... this is why I am so confused.

Daniel
-----
Daniel Boyer
boyer AT cs DOT sc DOT edu

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzLVlk4AAAEEAM+okxZsxsVtYBi7yAYj1G6eiKy3WFR8muG/WnteshJKGg53
XWaEiroqEKI4FkwAlFfY8/vwXyFClCMu++WHwFBms5Ik7Z1bhyhRgP9XoyPQ8ZAY
pYdoMr9g0KzDm3acCCTsZ4HbSgLJfBOzubO5ZjgFTi5eVyENSfVAKDiExlSRAAUR
tCFEYW5pZWwgUC4gQm95ZXIgPGJveWVyQGNzLnNjLmVkdT4=
=SBeX
-----END PGP PUBLIC KEY BLOCK-----

- Raw text -


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