Home > Back-end >  The problem is how to write? Help!!!!!!!!!!
The problem is how to write? Help!!!!!!!!!!

Time:10-09

Write a c of macro functions, synthesize four type unsigned char variable is an unsigned type interesting

CodePudding user response:

Wrong number of type int

CodePudding user response:

 # define UCHAR_TO_INT_U (a, b, c, d) (((a) & lt; <(24) + (b) & lt; <(16) + (c) & lt; <8) + d) 


Try this one -

CodePudding user response:

# define Byte32 (Byte4, Byte3 Byte2, Byte1) ((unsigned int) ((((unsigned int) (Byte4)) & lt; <24) \
| (((unsigned int) (Byte3)) & lt; <16) | (((unsigned int) (Byte2)) & lt; <(8) | ((unsigned int) Byte1))))

CodePudding user response:

And this operation???

CodePudding user response:

The union {
Unsigned int v.
Unsigned char ch [4].
} u;
Finished to ch array assignment, v directly came out, what to merge all need not

Unsigned char ch [4].
Int v=* (ch) (int *); Can also be
  • Related