Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > extra character...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 25476 of 27343
Post > Topic >>

extra character when writing file

by Jim <jim.moneytime@[EMAIL PROTECTED] > Apr 9, 2008 at 08:33 PM

Hi There,

I'm trying to read a file character by character.  When I write the
file out, there is one extra character which shows on the screen as a
solid circle with a small question mark in the middle.

Here is what I have:

	infile = fopen("encrypted.txt", "r");
	outfile = fopen("plain.txt", "w");

	while(!feof(infile)) {
		ch = fgetc(infile);
		fputc(ch, outfile);
	}

        fclose(infile);
        fclose(outfile);

Can someone please tell me why this character is getting added to the
outfile?
 




 9 Posts in Topic:
extra character when writing file
Jim <jim.moneytime@[EM  2008-04-09 20:33:38 
Re: extra character when writing file
Richard Heathfield <rj  2008-04-10 04:03:44 
Re: extra character when writing file
Peter Nilsson <airia@[  2008-04-09 21:12:29 
Re: extra character when writing file
Jim <jim.moneytime@[EM  2008-04-09 21:15:08 
Re: extra character when writing file
Richard Heathfield <rj  2008-04-10 04:30:08 
Re: extra character when writing file
"Bartc" <bc@  2008-04-10 09:09:17 
Re: extra character when writing file
Willem <willem@[EMAIL   2008-04-10 09:22:28 
Re: extra character when writing file
"Bartc" <bc@  2008-04-10 10:26:08 
Re: extra character when writing file
CBFalconer <cbfalconer  2008-04-10 10:36:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 21:17:01 CDT 2008.