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: 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 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-----