Re: A loop with C struct

From: Barry Schwarz (schwarzb_at_deloz.net)
Date: 10/31/04


Date: Sat, 30 Oct 2004 16:07:38 -0700

On 23 Oct 2004 12:34:38 -0700, ronenk@tauex.tau.ac.il (Ronen Kfir)
wrote:

>Thank you all!
>solve it with:
>
>while (fread(crnt, size, 1, FPcrnt))
> {
> rewind(FPprev);
> while (fread(prev, size, 1, FPprev))
> {
> for (j=0;j<TOTAL_PRLMNT_MBR;j++)
>
> {
> fread (prev, size, 1, FPprev);
> fread (crnt, size, 1, FPcrnt);
> if (crnt->ID!=prev->ID)
> fwrite (crnt, size, 1, FPNewMbr);
> }
>
> }
> }
This could not have possibly solved your problem as it causes you to
read more blocks from crnt than you wrote to it originally. See my
response to your previous post for a discussion of the real error.

<<Remove the del for email>>