Should we always initialize our int (perhaps this applies to char as well) to something so we dont risk using it uninitialized (well at least that is what gcc warns while using to the -Wall flag) ??? ( Even though knowing our code on a normal situation it is imposible that it happens)
Basically, yes, because initialising variables is a very good habit to get into. In the example you gave it doesn't make any difference, but if you change the code at some point such that i is used before the loop, you might forget it needs initialising and make yourself a tricky to find bug. As for z, I'd do this: int i=0; for(i=0;i<10;i++) { if(i==5) { int z=i; printf("%d\n", z); } } It's always a good idea to declare a variable as close as possible to the place it's used. Readers of your code then won't need to go paging up so far to find the variable type or initialisation. -- "...our desktop is falling behind stability-wise and feature wise to KDE ...when I went to Mexico in December to the facility where we launched gnome, they had all switched to KDE3." - Miguel de Icaza, March 2003