• Cursussen
  • Code Compiler
  • Discussiëren
  • Prijzen
  • Teams
Menu

Q&A Discussies

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 Stemmen
8 Antwoorden
5th Sep 2016, 3:38 AM
Pranav Dixit
Populair vandaag
Hello can anyone help me to learn gdscript
0 Votes
What coding language should i use to make a custom coding language?
0 Votes
hello world i need help
2 Votes
help string permutation
0 Votes
Any easy game ideas for beginners?
0 Votes
Hello! I’m 15 and I want to learn programming to become a web developer. Any advice?
0 Votes
Which is more important CSS vs HTML vs JS?
1 Votes
How many courses are there on Sololearn
1 Votes
Code is wrong somehow, I need help!
0 Votes
hi
1 Votes