• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu

Q&A Discussions

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 Votes
8 Answers
5th Sep 2016, 3:38 AM
Pranav Dixit
Hot today
Quiz App: Step 3, Restart Button
0 Votes
How to do a responsive page?
1 Votes
Running a python code
1 Votes
Can I make coding projects here and run them without sololearn pro, only in sololearn.
0 Votes
PHP
0 Votes
Ai in future
1 Votes
Is there any debugging practice here or not?
1 Votes
How create a new language ?
0 Votes
Hola
0 Votes
Hey I've done the C# and SQL beginner and intermediate, but still feel like there could be more... Is there advanced somewhere?
0 Votes