Here's my code:
int foo() {
int a = 1;
while(1) {
a *= 2;
printf("a = %d\n", a);
}
return a;
}
int main(void) {
foo();
return 0;
}
It just keeps printing out "a = 0". I'm confused! Am I missing something really simple?
Here's my code:
int foo() {
int a = 1;
while(1) {
a *= 2;
printf("a = %d\n", a);
}
return a;
}
int main(void) {
foo();
return 0;
}
It just keeps printing out "a = 0". I'm confused! Am I missing something really simple?