0

why that code doesn't work?

i learn about classes and try to make simple one, but it doesn't work. it suppose just to print a number, but clearly i have made some mistake. please tell my what i did wrong. thank you. https://code.sololearn.com/c0j5bqxi9TOt/?ref=app https://code.sololearn.com/c0j5bqxi9TOt/?ref=app

28th Apr 2021, 5:04 PM
‎Mmk
‎Mmk - avatar
2 Answers
0
You just forget brackets #include <iostream> using namespace std; class parents{ public: parents (int x,int y){ dad = x; mom = y; } void combine(){ cout << dad + mom; } private: int dad; int mom; }; int main(){ parents shar(34,23); shar.combine(); return 0; }
28th Apr 2021, 5:11 PM
YUGRAJ
+ 1
thank you very much
28th Apr 2021, 5:13 PM
‎Mmk
‎Mmk - avatar