do all class in c++ have constructor code example
Example: c++ class constructor
class MyClass {
public:
MyClass(); // This is the constructor
private:
int someInt;
};
MyClass::MyClass(void) {
someInt = 1;
}
class MyClass {
public:
MyClass(); // This is the constructor
private:
int someInt;
};
MyClass::MyClass(void) {
someInt = 1;
}