- 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; };
6 ответов
+ 3
I suggest to re-read the class learning module
+ 3
class MyClass {
public:
MyClass() {
mem = 12; }
~MyClass() {
}
private:
int mem;
};
+ 2
class is the first blank
+ 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;
};
+ 1
answer.
class
~MyClass() {
private
- 1
thanks all