New course! Every coder should learn Generative AI!
Try a free lessonQ&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
Strange narrowing conversion error from FLTK Color to Color Struct, Stroustrup's header Graph.h
0 Votes
Can anyone help me with this?
0 Votes
Python Question
3 Votes
How to learn fast C?
0 Votes
Initials of name
1 Votes
While loop with input dont work
1 Votes
Coder or Programmers
2 Votes