istream& pp::operator>>(istream& in)
{
//error msg
string msg = "ErPoint2Dror. Output from file , String is found instead of integer. Please check file for errors\n";
//ignore everything till next record
in.ignore(256,'[');
//store x cordinate
in>>x;
if(in.fail()){throw msg;}
//ignore everything till next record
in.ignore(256,',');
//store y cordinate
in>>y;
if(in.fail()){throw msg;}
//ignore the rest of the records till next line
in.ignore(256,'\n');
return in;
}//end of operator>> method
this is in my main
1 2 3 4 5 6 7 8 9
//get filename to input data into system
cout<<"\nPlease enter filename : ";
cin>>file;
getfile.open(file,ios::in);
pp pointObject();
getfile >> point;
IINM, that overload allows you to call point>>getline, not getfile>>point. For the latter, you'd have to define the overload as a friend function of pp: istream& operator>>(istream& in,pp &);