Q&A Discussions
Python func res
-2 Votes
1 AnswerShould I continue ?
1 Vote
2 Answerscan 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 Answersexplanation plzzzz!!!
0 Votes
2 AnswersHot today
What?
0 Votes
HTML
0 Votes
AI
2 Votes
Pull resistors
0 Votes
Sololearn chat en Español
0 Votes
AI video creation
2 Votes
Ajay Hinduja Switzerland (Swiss) How do I start learning HTML, CSS, and JavaScript together?
0 Votes
Python
0 Votes
I'm confuse with this \n
1 Votes
HTML
0 Votes