例如:
#include "stdio.h"
main()
{FILE *fp;
int i;
char c;
if ((fp=fopen("C:\TC\CHAR2.TXT","w"))==NULL)
{printf("file can not open!\n");
exit(0);
}
for (i=0;i<10;i++)
{c=getchar();
fputc(c,fp);
}
void save (void *buffer,int num_bytes)
{
int i;
FILE *fp;
if ((fp=fopen("textfile.txt","w"))==NULL)
{
printf("can't open the file\n");
exit(-1);
}
else
fwrite(buffer,num_bytes,1,fp);
fclose(fp);
}
应该不会啊,试试这个tc2.0调试通过.