I tried to run the following program in C and got some output. Can you help me out why???
#include<stdio.h>
int main()
{
char x='A';
printf("%d%d%d",sizeof("3"),sizeof('3'),sizeof(3));
return 0;
}
The output received is 2 4 4 using gcc in ubuntu 11.04 32 bit.
Similarly in other program:-
#include<stdio.h>
int main()
{
char x='A';
printf("%d%d",sizeof('A'),sizeof(x));
return 0;
}
The output received is 4 1 using GCC in ubuntu 11.04 32 bit.
Can you help me out why the output is this way???