Oh, and if you aren't using C++11 (which I haven't yet!), these would have to be declared in the parametric constructor. I kid you not, I tried defining it in the default constructor, and when I called the parametric constructor and functions, the values were erased!
I tried defining it in the default constructor, and when I called the parametric constructor and functions, the values were erased!
Uhh... yeah. That's because you didn't call the default constructor. The code in the default constructor doesn't get executed unless you default construct an object. When you use a parametric constructor only that constructor executes (read: it won't execute the default constructor).
An object cannot be constructed multiple times.
But I thought we went over this in another thread already. Was that you?