I am getting the error from the title, when I try to execute this piece of code :

list<Part>::iterator i = bullets.end();
--i;

if (!dartCollided) {
dartCollided = true;
Part temp = &amp;(i);
&(i) = new BrokenPart(i); //line giving the error
delete temp;
}

      Could someone help me point out the error?

&(i) = new BrokenPart(i);

This says: take the address of the object i (i.e. the number of the memory slot where i is) and change it so that it is equal to this other thing on the right (which is a pointer).

That makes no sense. How can you change the address of an object? You could move the object, yes, but reading a memory address and then changing it?
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.