prog 2 gyak Flashcards

1
Q

operator+

A

Osztalynev operator+(const Osztalynev &o); //header-ben
Osztalynev Osztalynev::operator+(const Osztalynev &o) const { //cpp-ben
Osztalynev eredmeny;
eredmeny = this + o;
return eredmeny; //egyéb feltétel a feladat szerint
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

operator+=

A

Osztalynev& operator+=(const Osztalynev &o); //header-ben
Osztalynev& Osztalynev::operator+=(const Osztlalynev &o){ //cpp-ben
this += o;
returt *this;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

operator++

A

Osztalynev& operator++(); //header-ben
Osztalynev& Osztalynev::operator++(){ // cpp-ben
this++; //inkrementálás más módon, ahogy a feladat kéri
return *this;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

operator«

A

friend ostream& operator«(ostream &os, const Osztalynev &o); //header-ben
ostream& Osztalynev::operator«(ostream &os, const Osztalynev &o){
return os &laquo_space;o; //és egyebek amit a feladat kér
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly