true. and it is an incredibly risky / counter-intuitive convention.
that means the following two pieces of code:
unsigned char a_ch;
unsigned char t_bit;
if (a_ch) a_ch=SOMETHING;
复制代码and
unsigned char a_ch;
unsigned char t_bit;
t=a_ch;
if (t) a_ch=SOMETHING;
复制代码will yield totally different execution.
If you look at some of the better compilers, you will notice that most of they don't have a (native) bitfield type. Boolean types are usually implemented as char or int.
For that reason, I do not use any bit types in my code.
true. and it is an incredibly risky / counter-intuitive convention.
that means the following two pieces of code:
- unsigned char a_ch;
- unsigned char t_bit;
- if (a_ch) a_ch=SOMETHING;
复制代码and- unsigned char a_ch;
- unsigned char t_bit;
- t=a_ch;
- if (t) a_ch=SOMETHING;
复制代码will yield totally different execution.If you look at some of the better compilers, you will notice that most of they don't have a (native) bitfield type. Boolean types are usually implemented as char or int.
For that reason, I do not use any bit types in my code.
一周热门 更多>