int main()
{
char c,a;
FILE *fptr,*fp2;
fptr = fopen("program.txt", "w");
printf("Enter a sentence:\n");
gets(c);
fprintf(fptr,"%s",c);
fclose(fptr);
fptr = fopen("program.txt", "r");
fp2 = fopen("test.txt", "w");
do
{
a = fgetc(fptr);
fputc(a, fp2);
}
while(a != EOF);
}
错误是:
error C2664: 'gets':cannot convert parameter 1 from 'char' to 'char*'