#include "stdio.h"
int main (void)
{
FILE *fp1, *fp2;
fp1 = fopen ("a.txt", "r");
fp2 = fopen ("b.txt", "w");
while (! feof (fp1))
putchar (getc (fp1));
rewind (fp1);
while (! feof (fp1))
putc (getc (fp1), fp2);
fclose (fp1);
fclose (fp2);
getch ();
return 0;
}
为什么把a.txt自制到b.txt中, 会多出一个空格的字符. 如a.txt只有三个字符, 而b.txt则会有4个字符.
[此贴子已经被作者于2006-5-12 20:34:31编辑过]