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 );
			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)
					check =0;

			x = file.eof();


after this code the next Write procedures stop working... ?? help!!

later on... i just use this... and yeah before that i make changes to the object files... but that ive checked by debugging mode that it does have my data in it! it just doesn't write it on the file.

file.open("LOGIN.DAT", ios::app | ios::out | ios::binary );
		file.write( reinterpret_cast<char*>(&p1), sizeof(p1));
		file.open("MEM.DAT", ios::app | ios::out | ios::binary );
		file.write( reinterpret_cast<char*>(&per1), sizeof(per1));

Where are p1 and per1 vars class definitions?
Why ios::app for input stream?
"stop working" - what is it?
Can you clearly describe your problem?

umm... those classes are very long and well just have data inputs basically...

as for it stops working part... its just that it wont write it on the .DAT file. once i read the file in the way it is written on the top... it wont write the information on the .DAT files. :\

and i have no idea what ios::app does... i copied it off internet.

ios::app flag means append or write at the end of file. Nobody can append anything to input file (and you? ).
it wont write is not a fact, it's a lyrics. Imagine that file.open("LOGIN.DAT") can't open file (wrong path, for example). You didn't test file state after open call. Suppose your p1 object is (or has) a std::string type object. You can't write string text with this barbaric reinterpret_cast approach...
An so on...

Diagnosis: insufficient info.

it does have all string type object... it also have a lot of files included... i can send you the whole software if you want... but the thing is its very messed up. not one of my better work. :\ thanks for help though. atleast now i know what ios::app stands for! :)

>it does have all string type object...
std::string objects contain pointers to text but not a text per se. So a pointer to std::string object never refers to a text.
Read about object serialization in C++: http://www.parashift.com/c++-faq-lite/serialization.html

>i can send you the whole software if you want...
Thank you. May be, some other time...