I have me problem in finding the error in the folowing program.the program writes all the information in an encrypted form would you help me in making it readable please?
the program is:
#include <iostream>
#include<fstream>
using namespace std;
struct customer
{
string fname;
string Lname;
int id;
};
int main()
{
for(int i=0;i<2;i++)
{
customer c;
ofstream outfile;
outfile.open("c:\\creat.txt",ios::in|ios::badbit);
cout<<"enter fname"<<endl;
cin>>c.fname;
cout<<"enter Lname "<<endl;
cin>>c.Lname;
cout<<"enter id"<<endl;
cin>>c.id;
outfile.seekp((c.id*0)*sizeof(c));
outfile.write((char*)&c,sizeof(c));
}
return 0;
}