Re: Error: 'for' loop initial declaration used outside c99 mode
- From: Andrew Poelstra <apoelstra@xxxxxxxxxx>
- Date: Fri, 03 Nov 2006 14:56:38 GMT
On Thu, 2006-11-02 at 21:42 -0800, Pedro Pinto wrote:
When compiling my program i got this error:
Error: 'for' loop initial declaration used outside c99 mode
This means that you did
for (int i = 0; i < n; i++)
....
Where you declared the variable i after you executed some
statements. The mixing of declarations and code is illegal
in C90 (the "old" standard), but is legal in C99 (the new
standard).
--
Andrew Poelstra <http://www.wpsoftware.net>
For email, use 'apoelstra' at the above site.
"You're only smart on the outside." -anon.
.
- References:
- Error: 'for' loop initial declaration used outside c99 mode
- From: Pedro Pinto
- Error: 'for' loop initial declaration used outside c99 mode
- Prev by Date: Re: character byte str[i] treated as signed, I need unsigned
- Next by Date: Re: get the address of a function??
- Previous by thread: Re: Error: 'for' loop initial declaration used outside c99 mode
- Next by thread: Cannot return values of char variable
- Index(es):
Relevant Pages
|
|