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 language test \ c language test \ test.c 9行目が間違っています。
日付:2020年2月29日
時間:22:26:38
任意のキーを押して続行...

おすすめ

転載: blog.csdn.net/weixin_42596333/article/details/104583806