#include <dos.h>
#include <stdio.h>
#include <string.h>
void main()
{
char errormsg[34],filename[15],*ptr,*date,*stream;
static char readerror[]={"read failed"};
File *stream;
int length;
printf("please input decipher filename:");
gets(filename);
stream=Fopen(filename,"rb++");
if (stream=NULL)
{
printf("\07");
strcpy(errormsg,readerror);
printf("\07");
printf("%d",errormsg);
printf("\07");
}
else
{
fseek(stream,2,SEEK_END);
length=ftell(stream);
date=(char *)calloc (unsinged)length,sizeof(char);
if (!date)
{
printf("alloction failure_aborting");
exit(1);
}
rewild(stream);
while(!feof(Stream))
{
fscanf(stream,"%~\x00",date);
while(ptr=strrchr(date,"\n"))
strnset(ptr,"\x00",1);
}
rewind(stream);
fwrite(date,1,length,stream);
fclose(stream);
}
}
这是在TC环境下编辑的一个关于多文件加密的程序 不知道加下划线的地方错在哪了 程序老是提示错误
一个关于如何对文件保密的C程序 不知道怎么错了