I need help with pointers and memory management.
I need to store different objects, all derived from the same base class, and have been using an array to do this but it is causing a segmentation fault when the array is populated with different objects.
My program works fine when the array is full of objects of the same derived type. When the array is populated with different objects it works as it is supposed to through the object stored at the first position but then when it switches to output the second object it gives me the segmentation fault. I know that this is a memory access issue but I am unclear how I'm supposed to manage a variable amount of objects dependent on user input.
thx, nmr