05-18-2024, 09:55 PM
(This post was last modified: 05-18-2024, 10:14 PM by Kernelpanic.)
Damned! Sure, āiā is 10 here. It gets clearer here (Korrektur, that is clearer):
Code: (Select All)
#include
#include
int main(void)
{
int i;
for (int i = 0; i < 5; i++)
{
printf("\n%2d", i);
}
printf("\n\n");
for (int i = 1; i < 5; i++)
{
printf("\n%2d", i);
}
//"i" is not initialized
printf("\n\n%2d", i);
//"i" is not initialized + 10
printf("\n\n%2d", i = i + 10);
printf("\n\n%2d", i = 10);
return(0);
}
Now "i" points to a memory address because it hasn't been assigned a value, plus 10. Yes, "i" is local.