Q&A Discussions
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 Votes
8 AnswersHot today
Where is all of the lecon?
1 Votes
Java
1 Votes
Html
1 Votes
Notes app bug
1 Votes
Java
0 Votes
Is there any free coding app?
0 Votes
Not getting Badge issue
0 Votes
BASIC
0 Votes
Imported Code not working
1 Votes