(C语言)每日代码||2023.12.21||C语言预处理命令,#define、#line、__LINE__、__FILE__

#include <stdio.h>
#define AAA 111
void test() {
    printf("__LINE__ = % d\n", __LINE__);
    printf("AAA = %d\n", AAA);
}
#define AAA 222
#line 1 "test"

int main(){
    printf("test\n");
    test();
    //__LINE__ =  1132
    //AAA = 111
    printf("\n");
    printf("\n");

    printf("__LINE__=%d\n", __LINE__);//__LINE__=10
    printf("AAA=%d\n",AAA);//AAA=222
    printf("%s\n", __FILE__);//test
    printf("\n");
	return 0;
}
posted @ 2023-12-21 19:45  Kazuma_124  阅读(10)  评论(0编辑  收藏  举报