while(0),, array[0]
来源:互联网 发布:python 中文版 pdf 编辑:程序博客网 时间:2024/04/29 19:10
1.
do{ /
code... ; /
code...; /
}while(0)
Why do we use "do while(0)" : This macro define can check if the defined symbal are excueted as a whole. here is an example.
if we define BST_DEBUG(fmt...)
#define BST_DEBUG(fmt...) printf("BST USI Debug %s /n", ##fmt); /
printf("File: %s, Line:%d /n", __FILE__, __LINE__)
instead of
#define BST_DEBUG(fmt...) do{ /
printf("BST USI Debug %s /n", ##fmt); /
printf("File: %s, Line:%d /n", __FILE__, __LINE__); /
}while(0)
. We will confrant with the problem if use it like this
if(a>0)
BST_DEBUG("Only one line output.../n");
So we can find that the latter define can output all string correctly.
-------------------------------------------------------------------------------------
2.
typedef struct mytype
{
int type;
int len;
int array[0];
}
-----------------------------------------
3
- while(0),, array[0]
- while(0),while(1),while(表达式)
- do...while(0)
- do{}while(0)
- [转载]Do{}While(0)
- do {} while (0) 用法
- do-----while(0)
- do...while(0)
- do{}while(0)妙用
- do while(0) 用法
- do {} while (0)
- while(0)的用法
- do..while(0)使用
- do{ ... } while(0)
- do-while(0)妙用
- do...while(0)用法
- do{...} while(0);
- do{ ... } while(0)
- PHP Hacks
- Microsoft.SQL.Server.2008.Enterprise.Edition - ZWTiSO下载地址
- Objects First with Java: A Practical Introduction Using BlueJ
- 使用SQL操作XML
- Effective C++ : 55 Specific Ways to Improve Your Programs and Designs
- while(0),, array[0]
- XML Programming: Web Applications and Web Services With JSP and ASP
- 其实我真的很孤独
- FreeTextBox(版本3.1.1) 使用详解
- OpenGL® Shading Language, Second Edition
- Linux操作系统下IPTables配置方法详解
- vs2008出sp1了!
- GPRS for Mobile Internet
- Professional CSS: Cascading Style Sheets for Web Design