#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *fp;
char ch;
if((fp=fopen("d:\\C_exercise\\example\\c1.txt","w"))==NULL)
{
printf("Cannot open this file.\n");
exit(1);
}
while((ch=getchar())!='\n')
fputc(ch,fp);
fclose(fp);
return 0;
}
文章评论(0条评论)
登录后参与讨论