Re: Error: 'for' loop initial declaration used outside c99 mode



Richard Bos wrote:
james of tucson <jmcgill@[go_ahead_and_spam_me].arizona.edu> wrote:


Pedro Pinto wrote:

When compiling my program i got this error:

Error: 'for' loop initial declaration used outside c99 mode

What is it and how can i solve it?

You're coming to C from a Java background, aren't you?

This is illegal in most C dialects; it is a legal C++ declaration, and
so may be accepted if you are compiling C with a C++ compiler:


Unless you severely hobble your C, that is not generally possible.

Severely hobble is going a bit far, just avoid the subset of C that
doesn't intersect with C++.


--
Ian Collins.
.



Relevant Pages