입니다. 다음 코드는 y를 답으로하지만 42를 y에 할당하지 않았습니다. y는 42가 될 수 있습니까?할당되지 않은 변수의 값은
#include <stdio.h>
void doit2(void)
{
int x;
int y;
if (x == 42)
{
printf("x is the answer\n");
}
else if (y == 42)
{
printf("y is the answer\n");
}
else
{
printf("there is no answer\n");
}
}
void doit1(int a)
{
int b = a;
}
int main(void)
{
doit1(42);
doit2();
}
"어떻게하면 * 42 * 될 수 있습니까?" –
y가 무엇을 기대합니까? – recursive
중복 : http://stackoverflow.com/questions/1225788/uninitialized-values-being-initialized/1225790 – GManNickG