|
-
October 18th, 2004, 08:51 PM
#1
The problem with fprintf
I write some codes below
FILE * fp;
int j=0;
char FileName[100]={0};
sprintf(FileName,"C:\\mttemp.txt");
if((fp=fopen(FileName,"a+"))!=NULL)
{
j=fprintf(fp,"hello\n");
fclose(fp);
}
After execute it , var j is 6,and the new file C:\mttemp.txt was created,but there is nothing in the file C:\mttemp.txt.
What's wrong?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|