Author: user user

Why should/shouldn’t I use the “new” operator to instantiate a class, and why?

I understand that this may be construed as one of those “what’s your preference” questions, but I really want to know why you would choose one of the following methods over the other. Suppose you had a super complex class, such as: class CDoSomthing { public: CDoSomthing::CDoSomthing(char *sUserName, char *sPassword) { //Do somthing… } CDoSomthing::~CDoSomthing() […]