linux define宏定义括号不能折叠

来源:互联网 发布:ubuntu拼音输入法 编辑:程序博客网 时间:2024/06/05 15:36

#include <stdio.h>
#include <string.h>

#define ONE 1
#define TWO 2

void fun()
{
        int i=0,j=2;
#if  ONE == 1
        for(i=3; i>0; i--){
#else
      for(i=3; i>0; i--){
#endif
         printf("ONE \n");
        //这个右花括号'}'的位置,应该和上个左花括号'{' 对齐,位置不要随便
        }

#ifdef TWO
       printf("TWO \n");
}
#endif


int main()
{
        fun();
        return 0;
}


.

0 0