Overloading default Constructors

closed account (365X92yv)
I know you can overload certain constructors when working with classes, such as the default constructor, the destructor, and even the + and = operator constructors. I was just curious if you could overload the new constructor so that when you create a new "thing" with a pointer, it can go through and instead of just defaulting it to have nothing in its data, set the data to zeroes or some other user-wanted default.
When you create a pointer, you don't create the thing for it to point to, unless you create it like this:

someObject* p = new someObject;

in which case yes, the appropriate constructor for the someObject gets called and if that constructor has values being set, they get set.
Topic archived. No new replies allowed.