照办书上的文件写入函数,却无法写入.----fputs---奇怪
#include "stdio.h"#include "conio.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
FILE *fp;
FILE *fp2;
char len1,len2,line[200],str[200];
char *p,ch;
main(void)
{ fp2=fopen("E:\\09GPLB\\GAME-TXT\\tpc.txt","w");
ch=2;
if((fp=fopen("E:\\09GPLB\\GAME-TXT\\temp.txt","r"))!=NULL)
{
len2=0;
while(!feof(fp))
{
fgets(line,60,fp);
len1=strlen(line);
len1++;
len2=len1+len2;
fputs(line,fp2);
getch();
}
fclose(fp);
fclose(fp2);
}
} --------------------编程问答-------------------- fgets(line,60,fp);
len1=strlen(line);
len1++;
len2=len1+len2;
调试看看line的值是什么
补充:.NET技术 , C#