If you can use C99 then declaring the loop counter within the for statement might avoid some of these ; issues:
Code:#include <stdio.h>
int main(void)
{
int array[10] = {0};
for (int i = 0; i < 10; ++i);
{
printf("%d\n", array[i]);
}
return 0;
}
since i won't be in scope after the loop.Quote:
8 C:\file.c `i' undeclared (first use in this function)
If you are using Dev-C++ with Mingw then you should be able to see warnings by typing this in Compiler settings: -Wall -Wextra (look up references for more specific warnings) and -std=c99 to compile in C99 mode (not C90 which doesn't allow declaring the loop counter there).Quote:
My bloodshed i have a feeling that doesnt shows warnings, just errors.
