• Corsi
  • Compilatore di codice
  • Discuti
  • Prezzi
  • Squadre
Menu

Discussioni 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 Voti
8 Risposte
5th Sep 2016, 3:38 AM
Pranav Dixit
Popolare oggi
Need suggestions
0 Votes
Need suggestions to learn AI and ML
1 Votes
Best code for creating games?
0 Votes
Java full stack
0 Votes
Calculator
0 Votes
progaming
0 Votes
Duration of heart refilling
0 Votes
Why isn't a linked video not working
0 Votes