Witam
Mam pewien problem z przeciążeniem operatora ">>" . Gdy chcę go użyć otrzymuję komunikat "Segmentation fault (core dumped)".
Nie mam kompletnie pojęcia co jest źle :/
class MayCal{
protected:
double liczba;
public:
MayCal():liczba(0.0){}
MayCal(double liczba2):liczba(liczba2){}
friend ostream & operator<< (ostream & wyjscie, const MayCal & a);
friend istream & operator>> (istream & wejscie, const MayCal & a);
};
ostream & operator <<(ostream & wyjscie, const MayCal &a){
wyjscie<<a.liczba;
return wyjscie;
}
istream & operator >>(istream & wyjscie, const MayCal &a){
wyjscie >> a.liczba;
return wyjscie;
}