Kursy
Zaloguj sięZacznij uczyć się AI
Kursy
Zaloguj sięZacznij uczyć się AI

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+
c++operator-overloading
0 głosów
8 odpowiedzi
5th Sep 2016, 3:38 AM
Pranav Dixit
Popularne dzisiaj
Activities on sololearn
5 Votes
Html issue
2 Votes
Can you help me ?
1 Votes
Code coach
0 Votes
How I can use div
1 Votes
Cybersecurity jobs without degree
1 Votes
TIPS From Veterans
3 Votes
App development 🔥☝️
1 Votes
Computer architecture
1 Votes
What am I doing wring?
1 Votes