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
?
精彩评论