2020-10-13 01:12 AM
I wonder about the keeping signed and unsigned values in proccessor.
For example I have this define
#define MY_NUMBER 8
How to decide MCU number of "8" signed or "unsigned" value.
How to convert binary number to keeping.
For example I am doing static analysis this define give an message give a signed or unsigned indicator. Sometimes I have to use like that #Define MY_NUMBER 8U
2020-10-13 06:39 AM
> How to decide MCU number of "8" signed or "unsigned" value.
A bare number "8" in C code will become a signed int. To make it unsigned, add the U suffix. This is not something you can configure elsewhere. Note that a #define isn't a variable, it's just used by the preprocessor. The signed/unsigned errors will happen where/how you use it.
> How to convert binary number to keeping.
I'm not sure what you're asking here. You can write a binary literal using a 0b prefix. So 0b1111011 would evaluate to 123.