VivienG
VivienG

Reputation: 2180

#define as unsigned char

I would like to know how can I tell to compiler that a #define is an unsigned char.

#define SET_BITS_LOW 0x80

Here SET_BITS_LOW is, by default, an int but I want an unsigned char

Upvotes: 3

Views: 9905

Answers (1)

Rahul Tripathi
Rahul Tripathi

Reputation: 172458

You may try like this:

#define SET_BITS_LOW  ((unsigned char)0x80)

Upvotes: 7

Related Questions