F&A Diskussionen
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 Stimmen
8 AntwortenHeute heiร
Functions in python
2 Votes
How to make a playground
1 Votes
Html 5 document question
1 Votes
Python
0 Votes
Actual Artificial Intelligence
0 Votes
Need friends
0 Votes
Schuffle a list
0 Votes