: : but if I write this:
: :
: : void main()
: : {
: : int i=2;
: : printf("%d");
: : }
: :
: : The Output is 2
: :
: : I can assign "i" any integer value the output will be that integer value.
: :
:
: I think that if you look at the compiled code of this it will convert to:
:
:
: mov ax,2
: call printf
:
: and printf("%d",2); would be compiled to
:
: mov ax,2
: call printf
:
:
: The same...
:
: The guys who designed the compiler forgot that possibility. It should be undefined behavior or something, so that's what happens.
:
: Happy coding wishes
: the one and only
:
Niklas Ulvinge aka IDK
:
:
Thanks Niklas I think you hit upon the right reason.