stuck in this class question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 5

stuck in this class question

can anyone help me regarding to this question please , Drag and drop from the options below to declare a class "MyClass", with corresponding constructor and destructor. Constructor initializes class's private integer member named "mem". ____MyClass { public: MyClass() { mem = 12; } _____{ } _____: int mem; };

10th Jan 2019, 11:11 AM
Manizha Nazari
Manizha Nazari - avatar
6 Answers
+ 3
I suggest to re-read the class learning module
10th Jan 2019, 11:24 AM
KrOW
KrOW - avatar
+ 3
class MyClass { public: MyClass() { mem = 12; } ~MyClass() { } private: int mem; };
27th Sep 2019, 6:14 PM
Shaima Alassil
Shaima Alassil - avatar
+ 2
class is the first blank
10th Jan 2019, 11:17 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
____MyClass { // keyword to state you are declaring a class public: MyClass() { mem = 12; } _____{ // destructor name syntax for MyClass } _____: // keyword to make the following data private int mem; };
11th Jan 2019, 3:23 AM
John Wells
John Wells - avatar
+ 1
answer. class ~MyClass() { private
23rd May 2020, 10:40 PM
Ubi Thomas
Ubi Thomas - avatar
- 1
thanks all
4th Jun 2020, 6:46 AM
Waled Moumari
Waled Moumari - avatar