Let\'s consider this example.
class StaticlyManagedObject
{
//some class members....
}
class DynamiclyManagedObject
{
StaticlyManagedObject _staticlyManage
Irrespective of the type (be it a struct, class or primitive), when using the new operator in C++ or dynamic allocation in C with malloc (which gets the size of your struct as parameter, to know how many bytes to allocate) - all of the space required (containing members) will be placed on the heap.
These calls return a pointer to the heap memory zone which was allocated.
Local function variables and parameters are always placed on the stack.
If you declare a pointer local variable its place will still be on the stack, but you will have to use the dynamic allocation methods mentioned above to allocate heap memory to which your stack-allocated pointer will actually point to.