0

error for variable question

It says variables must be declated before their use. They can actually be used at the time of their decleration (for loop for example)

17th Sep 2017, 12:51 AM
mike menard
4 Antworten
+ 5
in a loop you do have to declare a variable before or while using it. example here we declare a local variable used in the for loop for (int x=0; x<5; x++) printf("x=%d",x);
17th Sep 2017, 1:19 AM
OUMAS Abdellah
OUMAS Abdellah - avatar
+ 1
it means if it never existed in the first place
17th Sep 2017, 12:54 AM
Joshua
Joshua - avatar
+ 1
as in int a vs just using a without the int
17th Sep 2017, 12:55 AM
Joshua
Joshua - avatar
0
The first parameter in a for loop is the decleration. You can not point to something that does not exist.
17th Sep 2017, 1:54 AM
Coinage
Coinage - avatar