Pointer in Object

I'm wondering if I use a pointer inside an object and the pointer is from an object that keeps allocating more memory constantly, if the former object's size increases also?

I would want to make a memory pool, so I wanted to know if it was possible.

Thanks in advance.
Nope. The pointer points to a place in memory and takes up the same amount of space at all times.
A pointer has a fixed size, and contains the address of a different block of memory.

If your manager object keeps allocating memory to a pointer, you have a memory leak unless you delete the previous object first.
If your manager object keeps allocating memory to a pointer, you have a memory leak unless you delete the previous object first.

I'm having trouble understand this. Sorry.

Here is my application of the question:

What if my manager keeps a list and my object keeps a pointer to the list? Will the object continue to have a fixed size regardless of what new items are added to the list with no problems?
Yes.

The list is off in memory somewhere. All the object contains is that pointer. It doesn't contain the list that the pointer points to. The size of the pointer is constant, so the size of the object doesn't change.
Topic archived. No new replies allowed.