Cursos
Fazer loginComeçar a aprender IA
Cursos
Fazer loginComeçar a aprender IA

Q&A Discussões

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 Voto
8 Respostas
5th Sep 2016, 3:38 AM
Pranav Dixit
Quente hoje
I have finished first in Saturn League 3 times in a row, why have I not been given the badge for “Intergalactic Champion”
3 Votes
I am new
1 Votes
Python intermediate help with dictionaries
0 Votes
Changing String Variables into int in C++
0 Votes
Advertising in Sololearn
1 Votes
Fill in the blank to declare a static variable.
0 Votes
Marquee
1 Votes
RUST'S FUTURE
1 Votes
Any Advise?
1 Votes
Popsacles Aufgabe
1 Votes