#define tag(n) printf("cpy=n"%d",cpy=##n)
void testFunction(){
int cpy18=19;
tag(18);
}
// printf("name is" #a "and age is" #b );
//结构体和含有位域的结构体大小比较
//位域的执行次数
/*
FILE *fp;
char buff[255];
fp=fopen("C:\cfree5\include\1.txt","w+");
fscanf(fp,"%s",buff) //读字符数组首地址
printf("%s\n",buff);
fgetc(fp,255,FILE(*fp)); //读取字符数组全部地址
printf("%s\n",buff);
*/
/*
fputc(fp,"这是一个文件");
fprintf("这是一个文件",fp);
fclose(fp);
*/
/*
struct struct_2{
int a;
int b;
int c;
}str1;
struct struct_3{
int a:1; //允许调用1次
// int b:1;
//int c:1;
}str2;
str2.a=2;
printf("str2:%d\n",sizeof(str2.a));
str2.a=3; //第二次调用
printf("str2:%d\n",sizeof(str2.a));
//printf("str1:%d\n",sizeof(str1));
*/
/*结构体的两种表示及位域*/
/*
struct struct_1
{
int a:1; //位域
float b:2;
double c:5;
/* data */
/*
}x,*p;
x.a=2;
p=&x;
p->b=3;
printf("a:%d\nb:%lf\n",x.a,p->b);
*/
/*
//初始化野指针
int *p=NULL;
//执行判断
if(p){
puts("指针为野指针:\n");
}esle{
puts("指针不为野指针\n");
}
/*
for(;;){
putchar(‘a‘);
}
register int a;
scanf("%d",&a);
printf("format\a");
void *malloc(int);
puts("a");
*/
}
int main(){
testFunction();
}
//定义迭代器
/*
int iterInval;
char string[10];
for(iterInval=0;iterInval<10;iterInval++){
scanf("%s",string);
printf("%s",string);
}
//清除多余的文件输入
fflush(stdin);
gets(string);
*/
/*
#pragma message("hello world")
void testFunction(){
*/
}【c学习-13】
原文:https://www.cnblogs.com/activecode/p/9550042.html