GNU
numenshane1
啥都懂点,啥都不精!
殊途同归
展开
-
GCC __typeof__ __extension__
The __typeof__ OperatorThe __typeof__ operator is another way to refer to the type of an expression. This feature is provided for compatiblity with the gcc compiler. The syntax of this operator ke原创 2010-05-11 10:37:00 · 6095 阅读 · 0 评论 -
macro tricks
<br /> <br /> <br /> C语言宏定义使用技巧 <br />写好C语言,漂亮的宏定义很重要,使用宏定义可以防止出错,提高可移植性,可读性,方便性等等。下面列举一些成熟软件中常用得宏定义。。。。。。<br />1,防止一个头文件被重复包含<br />#ifndef COMDEF_H<br />#define COMDEF_H<br />//头文件内容<br />#endif<br />2,重新定义一些类型,防止由于各种平台和编译器的不同,而产生的类型字节数差异,方便移植。<br />typed原创 2010-07-08 11:24:00 · 419 阅读 · 0 评论 -
operator sizeof ---compile time calculation
<br />c语言中判断数据类型长度符<br /> 用法 <br /> sizeof(类型说明符,数组名或表达式); <br /> 或 <br /> sizeof 变量名 <br /> 1. 定义: <br /> sizeof是C/C++中的一个操作符(operator)是也,简单的说其作用就是返回一个对象或者类型所占的内存字节数。 <br /> MSDN上的解释为: <br /> The sizeof keyword gives the amount of storage, in byte转载 2010-07-08 11:28:00 · 685 阅读 · 0 评论 -
__attribute__
<br />转载于http://afreez.blog.51cto.com/59057/7351<br />---------------------------------------------------------<br /><br />GNU C的一大特色(却不被初学者所知)就是__attribute__机制。__attribute__可以设置函数属性(Function Attribute)、变量属性(Variable Attribute)和类型属性(Type Attribute)。<br />_原创 2010-06-21 15:19:00 · 420 阅读 · 0 评论