Forum Discussion
Altera_Forum
Honored Contributor
20 years agochar takes 4 bytes?
char test_char=-5;
printf("test_char %x,%x,%x\n",test_char,(char)test_char,(unsign char)test_char); We expect the output was: >test_char fb,fb,fb but we got : >test_char fffffffb,ffff...
Altera_Forum
Honored Contributor
20 years agoMountain,
Mask it with 0xff, this will "cut" off the upper 24 bits. if((test_char&0xff)==good) Doug