emresel
Full Member level 5
Hi to all;
I am trying to display a char value as a unsigned integer on the screen;
output is;
"value is -1 as signed" is an expected output, since 255 is -1 as considered sign number.
why i can’t see “255 as unsigned”? Why 4294967295 printed on the screen?
How can i achieve this?
Thanks
I am trying to display a char value as a unsigned integer on the screen;
Code:
char a=255;
unsigned int b;
//Then i want to print on screen;
b=(unsigned int)a;
printf(“value is %d as signed, %u as unsigned\n”,b,b);
output is;
value is -1 as signed, 4294967295 as unsigned
"value is -1 as signed" is an expected output, since 255 is -1 as considered sign number.
why i can’t see “255 as unsigned”? Why 4294967295 printed on the screen?
How can i achieve this?
Thanks