S
Suresh V
I am reading the book "The complete reference C++" i see that minimal
range of char has been mentioned as -127 to 127 similarly for short
int it is mentioned as -32767 to -32767.
But i try to assign
char ch = 128;
short int i = 32768;
printf ("ch = %d", ch); \\ prints ch = -128
printf ("ch = %d", i); \\ prints ch = -32768
I got confused after seeing the result. How come it is possible to
print even -128 if minimal range is (-127 ot 127) same applies to
short int ?
range of char has been mentioned as -127 to 127 similarly for short
int it is mentioned as -32767 to -32767.
But i try to assign
char ch = 128;
short int i = 32768;
printf ("ch = %d", ch); \\ prints ch = -128
printf ("ch = %d", i); \\ prints ch = -32768
I got confused after seeing the result. How come it is possible to
print even -128 if minimal range is (-127 ot 127) same applies to
short int ?