How the output of this code is 16?Code:main()
{
double d;
printf("%d", (unsigned int)((double *)0+2));
}
Printable View
How the output of this code is 16?Code:main()
{
double d;
printf("%d", (unsigned int)((double *)0+2));
}
It's 16 due to pointer arithmetic. (double*)0+2 is the same as 0+2*sizeof(double).
Didn't we just do this question in another thread?