We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
how is it possible to determine if a char value is smaller than 0x00?
char value=0xFE; if((char)value < (char)0x00) printf("< 0\n");
Working with uvision mdk-arm I get always a warn-message "pointless comparison of unsigned integer with zero"
best regards Hans-Peter
Avoid plain char as a small integer type and instead use 'signed char' or 'unsigned char'.
Or, better yet, use int8_t and uint8_t defined in stdint.h. For portability and performance, you can also use int_fast8_t and uint_fast8_t defined in the same header.