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.
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?
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.