ok thanks a lot
know i have a more clear idea how streams work.
one more thing:
when trying to write a user defines objet to a file how the reinterpret_cast converts the objet direction to a char pointer? ie:
ofstream myFile("myFile.txt", ios::binary);
myfile.write(reinterpret_cast<const char*>(toyota), sizeof(toyota);
//whats the trick behind reinterpret_cast??
//because toyota can have data members like char, int , double, etc, how is treated
//this data to convert it to char???
thanks for your help