C语言中的几个特殊的宏的使用

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

void test01(char* p)
{
	if(p == NULL)
	{
		printf("文件:%s 的 %d 行 出错了\n",__FILE__,__LINE__);
		printf("日期:%s\n",__DATE__);
		printf("时间:%s\n",__TIME__);
	}
	
}


int main()
{
	test01(NULL);

	return 0;
}

输出结果:

文件:e:\users\hp\documents\visual studio 2010\projects\c语言test\c语言test\test.c 的 9 行 出错了
日期:Feb 29 2020
时间:22:26:38
请按任意键继续. . .

猜你喜欢

转载自blog.csdn.net/weixin_42596333/article/details/104583806