Sesiones de PyR
can anyone plz explain me this program step by step?#include <iostream>
using namespace std;
class MyClass {
public:
int var;
MyClass() { }
MyClass(int a)
: var(a) { }
MyClass operator+(MyClass &obj) {
MyClass res;
res.var= this->var+obj.var;
return res;
}
};
int main() {
MyClass obj1(12), obj2(55);
MyClass res = obj1+obj2;
cout << res.var;
}I am not getting the part inside operator+
0 Votos
8 RespuestasOperator overloading
0 Votos
11 RespuestasPointer manipulation
2 Votos
4 RespuestasWhy it's not working?
1 Voto
1 RespuestaEn tendencia hoy
Ai generated practices
1 Votes
Where did mess up....
1 Votes
Feedback on my portfolio
0 Votes
I need a siren sound
0 Votes
Yo this is madness
0 Votes
How can i insert files?
1 Votes
Patters of library class
0 Votes