The new operator works by allocating space just as malloc() does. If the type used with the new operator is an object type, the constructor is invoked automatically with the use of the new keyword, whereas the constructor is never invoked with the use of malloc().