• Kursy
  • Kompilator kodu
  • Dyskusja
  • Cennik
  • Zespoły
Menu

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
My codebits section is full of deleted codes
13 Votes
Ai generated practices
2 Votes
I have an error in a problem and I don't know what the correct answer is
1 Votes
Solving coding challenges
0 Votes
Feedback on my portfolio
0 Votes
Yo this is madness
0 Votes
How can i insert files?
1 Votes
Advertising in Sololearn
0 Votes
Hi who can hel me please
0 Votes
How to code on own computer? HELP
0 Votes