we are making a project for the uni its a about an ebay .....we are making a registration dialogue we want to store information in the sign up dialogue and to read it in the log in

we were working on a text file ..but the project required a binary file

ofstream ofile;

string firstname, lastname, Email, password,id;
CString csfirstname, cslastname, csEmail, cspassword,csid;
GetDlgItemText(IDC_EDIT2, csfirstname);
GetDlgItemText(IDC_EDIT6, cslastname);
GetDlgItemText(IDC_EDIT1, csEmail);
GetDlgItemText(IDC_EDIT7, csid);
GetDlgItemText(IDC_EDIT4, csid);

CStringA CSfirstnameA(csfirstname);
CStringA CSlastnameA(cslastname);
CStringA CSEmailA(csEmail);
CStringA CSpasswordA(cspassword);
CStringA CSidA(csid);

firstname = CSfirstnameA.GetBuffer();
lastname = CSlastnameA.GetBuffer();
Email = CSEmailA.GetBuffer();
password = CSpasswordA.GetBuffer();
id = CSidA.GetBuffer();

ofile << firstname << "_"<< lastname<< endl;
ofile << Email << " " << password << " " << id << endl;


it stores the file in text file but we want to store it in binary life

0 Answers