Object var;
creates an object that is valid until the end of the current region, usually up to '}'
Object* varp = new Object();
creates a pointer to a newly created object. The pointer (varp) is valid until en d of the scope, but the object itself exists until deletion is called on the pointer.
You should always prefer the first version if there is no reason to do the second. The second version takes up more memory (you need space for the pointer, as well as the object), takes more time (the system needs to allocate memory on the heap), and you need to call delete to free the memory when you are done with it.
source share