I've been reading a book on C++ for a while. I've been reading about how to create objects on the heap. If I'm right the difference when declaring would be something like this:
CObject *Object = new CObject;
which creates a pointer to the object on the heap where-as:
just creates it like usual.
It explains the concept but doesn't explain why you should want to use one or the other or anything, it just explains the difference.
I apologise for any technical innaccuracies, I'm new to a lot of this and I don't have the book to hand.
Sometimes, you are not sure how many objects you need at compile time, so you create them dynamically on the heap at run time. This is especially true when you need an unknown array of objects.
... or if you need a large array of items, it's better to use the heap, because the stack has a lower space limit.
... or if you need an object to exist beyond the scope of a function.
Object pointers should be used for the same tasks as normal pointers.
Thanks for the advice people, filled in the gaps.
Sorry for the double post Hammer, pressed refresh on the wrong page =)