Deleteing from memory after reference has returned
<p>I have a question about deleting things from memory in C++, and what will and will not exist any longer.  If I create a queue in C++ (standard library), add two elements to it, then call front(), store it in a regular variable (no pointer).  Then I call pop() on the queue.  The variable i stored will still exist right?  What happens if something edits the memory address where the pointer in queue used to live?  Does that mean the local variable i stored earlier is no longer valid since it was created from a reference?</p>

<p>Thanks for any clarifications.</p>
