//程序 输入输出缓存区 磁盘
#include <stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<string.h>
#include<errno.h>
int main()
{
FILE *f=fopen("tset.c", "w");//文件信息区
if (f==NULL)
{
printf("%s", strerror(errno));
return 0;
}
if (f != NULL)
{
fclose(f);
}
//fputc('a',f);//输出流
//printf("%c",fgetc(f));//输入流
f = NULL;
/*int ch = fgetc(stdin);
fputc = (ch, stdout);*/
//char buf[1024] = { 0 };
//fgets(buf,1024,stdin);
//fputs(buf,stdout);
//gets(buf)
//puts(buf
// 结构体用fprintf(f,%s",Stu.name
//fscanf(stdin,"%d",&(Stu.n)))
//fprintf(stdout,"%d",Stu.n)
///ssprintg把格式转化成字符输出 sscanf是读取出来
//fwrite fread
//fseeek(f,2,SEEK-CUR)
//ftell 告诉偏移量
//rewind让文件回到起始位置
//feof文件读取中,不能使用
//EOF是正常结束
//peeror()
//ferror读取错误
//feor正确
int ch = 0;
while ((ch=fgetc(f)!=EOF))
{
putchar(ch);
}
if (ferror(f))
{
printf("no");
}
else if (feof(f))
{
printf("yes");
printf("%s", _FILE_);
printf("%s", _TIME_);
}
return 0;
}
//编译 链接
//预编译 编译 汇编
//test.i 、、test.s test.o 把汇编指令转化成二进制指令 合并链表和符号表的重定位
//语法分析 词法分析 语义分析
//符号分析
//defind STR / reg register/ do_forever for(;;)
//宏效率高不能区别数据类型
#ifdef DEBUG
#endif // DEBUG
//#if #elif #endif #if defined(DEBUG)
//#defind OFFSETOF(struct_name,member_name) &(int *)((struct_name*)0)->member_name)
C语言预处理
最新推荐文章于 2024-07-24 06:12:13 发布