Hey...
ok before i start i want to say that i'm not a very good programmer... and i'm new with this... and i got a project that i have to submit in 2 days so i badly need help!!
ok the problem is:
I'm using binary file handling, a code snippet i got from internet.... i use it to copy data from a .DAT file to an class object. i use that object through out the program. in the other part i input data in an object and then copy it to a .DAT file... now that was working just fine...
until i wanted to check if the username already exist it shouldn't let it duplicate... therefore i READ the .DAT file before to put a check. but after that it wont write on any file. i got two .DAT files... and it wont write my data on either of them...
file.open("LOGIN.DAT", ios::app | ios::in | ios::binary );
file.seekg(0);
x = 0;
check =1;
while(x == 0 && check != 0)
{
i = 0;
file.read( reinterpret_cast<char*>(&p2), sizeof(p2) );
if(strcmp(name,p2.get_name()) == 0)
{
i++;
check =0;
}
x = file.eof();
}
file.close();
}
after this code the next Write procedures stop working... ?? help!!