Hi friends,
I am using GNU GCC Compiler
OS: win7 32bit
/* Program 4.2 Drawing a box */
#include <stdio.h>
int main(void)
{
printf("\n**************"); /* Draw the top of the box */
for(int count = 1 ; count <= 8 ; ++count)
printf("\n* *"); /* Draw the sides of the box */
printf("\n**************\n"); /* Draw the bottom of the box */
return 0;
}
when i try to compile the code i got fallowing error.
C\48.c|6|error: 'for' loop initial declarations are only allowed in C99 mode|
C\48.c|6|note: use option -std=c99 or -std=gnu99 to compile your code|
If anybody know how to change it to c99mode please help me.
Thanks & Regards,
Deva
Hi, I changed to -std=c99 mode is this way correct ?
Please see picture
Untitled.png:
Hi friends,
My problem solved. many of them adviced me to change settings to -std=c99 But its not worked because my compiler is GNU GCC Compiler.
Here is see how the problem is fixed.
In the Compiler and Debugger settings. Compiler settings tab - Other Options. I added there -std=gnu99
So Problem solved.
Friends thanks very much for your advices & time.
Thanks & Regards,
Deva