Archived

This topic is now archived and is closed to further replies.

phil05

Inline Constructor/Deconstructor C++ Question

Recommended Posts

Common() {Experience = 0;} ~Common(); Is this right constructor for an object to make a default "experience"?

Share this post


Link to post
Share on other sites
Yup that works fine. If you want to be an overacheiver, the more ideal solution is to use an initializer list, like this:


Common() : Experience(0) {}
~Common();


Initializer lists give you better performance.

Share this post


Link to post
Share on other sites