• Курсы
  • Компилятор кода
  • Обсуждения
  • Цены
  • Teams
Menu

Обсуждения

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 голосов
8 ответов
5th Sep 2016, 3:38 AM
Pranav Dixit
Актуальное сегодня
Need a personal tutor
1 Votes
I can't figure out how to use the getElementById code in JavaScript Code Playground, I've tried multiple times and watched YT
0 Votes
Fix code
0 Votes
..
1 Votes
How can I turn my .py files to .exe files?
1 Votes
Fast coding (mobile)
1 Votes
Software to write and run codes
1 Votes
Add lua
0 Votes
Beginner_to_SoloLearn
1 Votes
How to learn C++ and how long does it take
1 Votes