On 2010-01-31, Vijay <> wrote:
> while(!feof(pA)&& !feof(pB))
This is wrong. Never do this.
Test the reads you perform. feof() tells you whether a PREVIOUS read
ALREADY FAILED. That's not useful to you.
> fgetpos (pA, &position_A); // position_A-> 0
> fgetpos (pB, &position_B); //position_B-> 0
> a=fgetc(pA);
> b=fgetc(pB);
> fgetpos (pA, &position_A); // position_A-> 1
> fgetpos (pB, &position_B); //position_B-> 0
> I am using Visual Studio 2003 and 2008
But apparently you never actually opened the files. Or you didn't
think to offer a complete example.
The obvious thing that occurs to me to ask is whether fgetc()
worked in both cases. If b were EOF, then this could make sense.
However, it may also matter how you opened the files.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach /
usenet-
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!