我有以下类,我与friended cout
,现在我想朋友将其与cin
,但我得到一个错误......谁能帮我,或者告诉我,我做了什么错?
错误:
C:\ MinGW的\ BIN ../ LIB / GCC /的mingw32 / 4.6.1 /包括/ C ++ /比特/ stl_algo.h:2215:4:错误:使 'const的RAngle' 作为 '这个'“诠释RAngle的论点: :操作者<(RAngle)”丢弃限定符[-fpermissive]
类RAngle
:
class RAngle
{
private:
int *x,*y,*l;
public:
int solution,prec;
RAngle(){
this->x = 0;
this->y = 0;
this->l = 0;
}
RAngle(int i,int j,int k){
this->x = &i;
this->y = &j;
this->l = &k;
}
friend istream& operator >>( istream& is, RAngle &ra)
{
is >> ra->x;
is >> ra->y;
is >> ra->l;
return is ;
}
}