A Simple question

Youda He yhe at zip.eecs.umich.edu
Mon Apr 9 12:57:18 AEST 1990


Here is the sample program:
main()
{
  char a=255;
  unsigned char b = 255;
  printf("a=%X\n",a);
  printf("b=%X\n",b);
}

The result is 
a=FFFF
b=FF
on dos, by using zortech and mcs, char is 8 bit long, why a looks like 16bit?
what is the difference of char and unsigned char on printf? 

-- Youda



More information about the Comp.lang.c mailing list