hot to create a class object constructor c++ 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;
}