Here's the problem. I open the non-text file, then what I want to do is to check how many entries saved I already have so that I know where I will save my next entry on the said file. Here's what I did:
typedef structUserType arrUser[10];
if ((pUser = fopen("file.dat", "wb")) != NULL)
{
while (fread (&aUser[i], sizeof(structUserType), 1, pUser))
i++;
//What this supposedly does it to check how many saved entries are already in the file. The condition will return a 0 if the pointer is at the eof already//
scanf ("%s", aUser[i].strName);
//Here lies the problem because it seems that the counter isn't moving. So when I do this://
fwrite(&aUser[i], sizeof(structUserType), 1, pUser);
it keeps on overwriting on that same array of structure. Help!!!
So where did I go wrong? I'm stuck at this part forever!