ANSI C 是否支持有符号/无符号位域? [英] Does ANSI C support signed / unsigned bit fields?
本文介绍了ANSI C 是否支持有符号/无符号位域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将位域限定为有符号/无符号是否有意义?
Does it make sense to qualify bit fields as signed / unsigned?
推荐答案
标准的相关部分 (ISO/IEC 9899:1999) 是 6.7.2.1 #4:
The relevant portion of the standard (ISO/IEC 9899:1999) is 6.7.2.1 #4:
位域的类型应为合格或不合格_Bool、signed int、unsigned int 或其他一些实现定义的版本类型.
A bit-field shall have a type that is a qualified or unqualified version of _Bool, signed int, unsigned int, or some other implementation-defined type.
这篇关于ANSI C 是否支持有符号/无符号位域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文