C
cinhori
On the way
展开
-
C中的预编译宏定义
C中的预编译宏定义@(C)[宏]C中的预编译宏定义预处理命令简介预处理的方法预处理命令详述defineundefif elif else endififdef ifndef definedinclude include_next预定义宏linepragma _Pragmawarning error在将一个C源程序转换为可执行程序的过程中, 编译预处理是最初的步骤. 这一步骤转载 2017-03-08 16:46:26 · 340 阅读 · 0 评论 -
关于malloc()前是否需要类型转换,即void*转换为具体类型
之前在Stack OverFlow上贴了段代码,求帮忙找bug,意外的收获了关于malloc()前是否需要类型转换的一些说法,很涨姿势,贴出来大家共享 you don’t cast the result, since: - It is unnecessary, as void * is automatically and safely promoted to any other poin原创 2017-03-10 17:58:44 · 1472 阅读 · 0 评论