#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DEBUG
#define TEST
int main(int argc, char* argv[]) {
#ifdef DEBUG/*如果定义DEBUG*/
printf("debug\n");
#else
printf("release\n");
#endif // DEBUG
#ifndef TEST/*如果未定义TEST*/
printf("untest\n");
#else
printf("test\n");
#endif // !TEST
#if 0/*条件表达式*/
printf("01\n");
#else
printf("02\n");
#endif
/*特殊宏*/
printf("文件: %s\n", __FILE__);
printf("行号: %d\n", __LINE__);
printf("日期: %s\n", __DATE__);
printf("时间: %s\n", __TIME__);
system("pause");
return EXIT_SUCCESS;
}
C语言-预处理宏
最新推荐文章于 2024-09-17 09:33:17 发布