2019年12月18日
C++ char数组转word类型
#define Word2Chars(n,p) {\ (p)[0]=(unsigned char)(((n)>>8)&0xff);\ (p)[1]=(unsigned char)( (n)&0xff);\ } #define Chars2Word(n,p) {\ n= (((unsigned char)((p)[0])) << 8) + \ (((unsigned char)((p)[1])) ) ; \ }