Dyskusje Q&A
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 głosów
8 odpowiedziПомогите! Не понимаю задачу.
0 głosów
2 odpowiedziOperator overloading
0 głosów
11 odpowiedziPointer manipulation
2 głosów
4 odpowiedziJava operator clarification.
0 głosów
2 odpowiedziWhy it's not working?
1 Głos
1 OdpowiedźPopularne dzisiaj
SQL
3 Votes
HTML/CSS questions
0 Votes
What Does Pseudo Elements Mean.
2 Votes
IMAGE
0 Votes
Html
1 Votes
How to learn css and html
0 Votes
Find courses
0 Votes
Certificate Problem
0 Votes