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 AnswersOperator overloading
0 Votes
11 AnswersPointer manipulation
2 Votes
4 AnswersOperator Overloading<<
1 Vote
3 AnswersWhy it's not working?
1 Vote
1 AnswerThe Example In Lesson
1 Vote
2 AnswersПомогите! Не понимаю задачу.
-1 Vote
1 AnswerHot today
OOP python questions
1 Votes
What is a web browser intension?
1 Votes
Python loops
1 Votes
Web page
1 Votes
Percobaan
0 Votes
Mentors
0 Votes
Codding lern
0 Votes