ambigious overload for operator>>’ in ‘getfile >> point’

i keep getting the following error when i run this. any help?

ambigious overload for operator>>’ in ‘getfile >> point’

this is my code in pp object

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 &);
just for curusity is point a string variable or char array .
Topic archived. No new replies allowed.