• Курсы
  • Компилятор кода
  • Обсуждения
  • Цены
  • 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
Актуальное сегодня
Error in python
5 Votes
Why Sololearn Removed Our Saved Private Project (Codes), I Can't Find This Option.
2 Votes
Model Context Protocol ? What is it ?
4 Votes
Where have they gone
2 Votes
API
0 Votes
General Inquiry
0 Votes
PYTHON
2 Votes
Certificate
0 Votes
Activity Section in Profile has Gone
1 Votes
how to be good at coding
1 Votes