真爱无限的知识驿站

学习积累技术经验,提升自身能力

UC编程01-预处理

uc:unix c 的简称


code1:

#include<stdio.h>
int main()
{
#line 1550//指定下面一行行号为1550
int b=0;
printf("%d",a);
return 0;
}


code2:

#include<stdio.h>
#define VERSION 3
#if(VERSION<3)
#error "版本低"
#elif(VERSION>3)
#warning "版本高"
#endif
#pragma GCC dependency "a.txt"//比较文件修改时间
#pragma GCC poison goto//禁止后面的代码使用 goto关键字
#pragma pack(1)//指定对齐和补齐的基准大小
typedef struct s{
char c1;
short int i;
int i2;
char c2;
}ss;
int main()
{
//goto end;
printf("helloc c
");
printf("size=%d
",sizeof(ss));
end:
return 0;
}


发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.7.3

Copyright 2024-2027 pukuimin Rights Reserved.
粤ICP备17100155号