#include <stdio.h>
void p(void)
{
int y;
printf("d\n", y);
y = 2;
}
int main()
{
p(); p();
return 0;
}
The first value will be garbage or 0 because y has been instantiated but not initialized. The second value printed may be 2 because the value of y has by then been initialized to 2, and so may keep its value for the second printf.
No comments:
Post a Comment