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
overloading operators << >>
1 Votes
I dont now that how to do js
2 Votes
fully dynamic arrays
1 Votes
Wishkit alternative for android
1 Votes
How to start in web dev?
0 Votes
Hi
0 Votes
Issue in code
0 Votes
My question is about python?
0 Votes