C语言怎么样读取annot类型的文件呢,求解
这个是加密过的特殊文件吧,c语言只能读取比较常见的文件类型,像这种可能需要进行解密成可读的文件才可以
#include<stdio.h>
#include<string.h>
int main()
{
FILE *fp;
char string[6];//方括号中是几就输入几个字符串
if( (fp=fopen("file.txt","w"))==NULL )
{
printf("cannot open file");
return 0;
}
while(strlen(gets(string)) > 0)
{
fputs(string,fp);
fputs("\n",fp);
}
fclose(fp);
if( (fp=fopen("file.txt","r"))==NULL)/////这里换成annot类型文件名
{
printf("cannot open file\n");
return 0;
}
while(fgets(string,6,fp)!=NULL)
{
fputs(string,stdout);//系统自动打开stdout文件
}
fclose(fp);
}