2 Jun
2003
2 Jun
'03
11:51
Raúl Gutiérrez Segalés wrote: Hi,
I am trying to do a NOT operation but it doesnt seem to work well:
unsigned int i=8;
printf("%d \n", ~i);
This is suppose to print 247 but I get -9
sure? With "unsigned char" I would expect 247 but not with "unsigned int".
Any ideas of what am I doing wrong ?
Try "%u" instead of "%d" in your printf statement. Michael