初学者所以小软..我在下面编译一个简单的代码,我没有为我的变量分配任何值但是C程序会生成一些随机值,为什么会这样?(只有第二个变量生成随机整数)
那么这些价值观是从哪里来的呢?
#include<stdio.h>
main(void) {
int var1;
int var2;
printf("Var1 is %d and Var2 is %d.", var1, var2);
return 0; //Book says I should use this for getting an output but my compiler anyways compile and return me values whether I use it or not
}
//Output 1st compiled: var1 = 19125, var2 = 8983
//Output 2nd compiled: var1 = 19125, var2 = 9207
//Output 2nd compiled: var1 = 19125, var2 = 9127