I wrote a small code of C.
#include<stdio.h>
int main()
{
int a = 0;
printf("Hello World %llu is here %d\n",a, 1);
return 0;
}
It is printing the following ouput
Hello World 4294967296 is here -1216225312
With the following warning on compilation
prog.cpp: In function ‘int main()’:
prog.cpp:5: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 2 has type ‘int’
I know i need to cast the int to long long unsigned int, but i could not understand the fact that why the later values got corrupted.
Thanks in advance