For instance, if I were to have a game where I wanted bouncing dots within the screen, assuming that the dots were put into a list upon construction and the rendering and movement were handled, could I do this in main without shallow copies being made.
int main()
{
for(int i = 0; i < 10; i++)
{
Dot * temp = new Dot();
}
while(!quit)
{
//Handle the dot rendering and movement
}
}
I ask this because I did do something very similar and, whenever I attempted to remove the Dots in the list if they hit one another, after one Dot was deleted and I attempted to delete another I got a Segmentation Fault. Thanks in advance!