can you call the class constructor like a normal method?
can you call the class constructor like a normal method?
nope. Thats forbidden. constructors are called implicitly by you and explicitly by your compiler.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
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.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
ya, just have another function that resets all the values, and call that function when you need them to be reset ....