can you call the class constructor like a normal method?
Printable View
can you call the class constructor like a normal method?
nope. Thats forbidden. constructors are called implicitly by you and explicitly by your compiler.
arg...
how do i solve this problem then?:
ive made a game and at the end i give the option to play again.
if they want to play again, the values of all the member variables need resetting.
either redesign your game loop or design your classes for your needs. A constructor makes and initialises an object. If you want to set a new value in an already existing object then you will not use a constructor but instead use either an assignment operator or an explicit SetValue() type function.
ya, just have another function that resets all the values, and call that function when you need them to be reset ....