Kurse
AnmeldenBeginne KI zu lernen
Kurse
AnmeldenBeginne KI zu lernen

F&A Diskussionen

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 Stimmen
8 Antworten
5th Sep 2016, 3:38 AM
Pranav Dixit
Heute heiß
Activities on sololearn
1 Votes
What is problem in this code
0 Votes
playground input
0 Votes
This Program Does Something Weird. Can You Explain Why?
1 Votes
Software developer
0 Votes
Html issue
1 Votes
How I can use div
0 Votes
Asking for final year project ideas!
1 Votes
TIPS From Veterans
1 Votes
Playground input
0 Votes