开发者

Is this code declaring a type?

#ifdef _CPU_8BIT_INT_
// unsigned 8 bit
typedef unsign开发者_运维问答ed _CPU_8BIT_INT_ u8 ;

What is the code above doing? Is it trying to declare a type? (type as in integer, char etc.)


Yes, typedef is used to declare a type. From now on

u8 x;
/* Equivalent to. */
unsigned _CPU_8BIT_INT_ x;

Are you sure you're not better off using uint8_t from stdint.h ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜