Mail Archives: djgpp/1997/01/19/21:51:54
On Sat, 18 Jan 1997 19:11:57 GMT, boyer AT cs DOT sc DOT edu (Daniel Boyer) wrote:
>Ok, can somebody please tell me what is wrong with this line of code:
>
> for(char SIX = 'a'; SIX < '}'; SIX++)
> {
> .....
> }
You are attempting to compile this source from a C file. C does not allow new
variables to be declared within a loop; that is an extension provided in C++.
If you try that in Turbo C, it will work since Borland's compiler doesn't
strictly enforce the ANSI C standard. As an aside, if you instruct Turbo C to
strictly enforce the ANSI standard, their own header files won't compile. :)
- Raw text -