is there a possibility that a variable which is not appointed a number be appointed negative number by compiler?
I use Dev C++ and it prints "0", but what about other compilers?
Example:
int x;
printf("%d", x);
Dev C++ output: 0
is there a possibility that a variable which is not appointed a number be appointed negative number by compiler?
I use Dev C++ and it prints "0", but what about other compilers?
Example:
int x;
printf("%d", x);
Dev C++ output: 0
Not initializing your variable is undefined behavior under any compiler.
So yes, you could have positive, negative number, or zero.