#include<stdio.h>
#include<process.h>
#define SIZE 10
char reverse(char *s)
{
if(*s!='\0')
return(reverse(s));
reverse(s+1);
putchar(*s);
}
void main()
{
char *s;
FILE *fp;
char c[10],i;
if((fp=fopen("input.txt","wt+"))==NULL)
{
printf("error!\n");
exit(1);
}
else
{
printf("输入文件内容:");
for(i=0;i<SIZE&&!feof(fp);i++)
c[i]=fgetc(fp);
c[i]='\0';
puts(c);
fclose(fp);}
if((fp=fopen("ouput.txt","wt+"))==NULL)
{printf("error!\n");
exit(1);
}
else
{
fprintf(fp,"文件内容:%s\n",reverse(s));
fclose(fp);
}
}
Compiling...
Skipping... (no relevant changes detected)
xz.cpp
xz.obj - 0 error(s), 0 warning(s)
这是编译之后的提示