default arguments in constructor
default arguments in constructor
Can I use default arguments in a constructor like this maybe
Soldier(int entyID, int hlth = 100, int exp = 10, string nme) : entityID(entyID = globalID++), health(hlth), experience(exp), name(nme = SelectRandomName(exp)) { }
I want for example exp = 10 by default but be able to override this value if I supply it in the constructor otherwise it should use the default.
How can I do this, I know…
View On WordPress













