Code:
#include<stdio.h>
main()
{
for ( i = 0; i < 10; i++)
{
printf("%d", i);
if ( i == 4);
{
break;
}
return 0;
}
}
Error message: error: 'i' undeclared (first use in this function)|
Anything?
Printable View
Code:
#include<stdio.h>
main()
{
for ( i = 0; i < 10; i++)
{
printf("%d", i);
if ( i == 4);
{
break;
}
return 0;
}
}
Error message: error: 'i' undeclared (first use in this function)|
Anything?
Yeah, you forgot to declare the variable named i.
Would be suffice?Quote:
i = o
No, a declaration of a variable includes its type. So:
Code:int i = 0;
Ok. Thank you.