0
c++ Constructor
can someone tell me why my constructor isn't working. I want to be able to create a monster with an initial energy level https://code.sololearn.com/ctJXaXU74uk8/#cpp
1 Antwort
+ 4
so close!
Constructors go inside the class
class classname {
public:
classname() {} // constructor
void method(); // method (class function)
private:
int member; // member ( class data)
};
edit:
also: note what data type your constructor needs and what you passed to it.
Hint; pointers