I have an iterator going through a list of cars. I need to set a pointer to point at what the iterator is pointing at so I can move the iterator forward and delete the item the pointer is pointing at (what the iterator was previously pointing at)?
This is C++ programming.
Is this in .Net?
You can’t do that. When you’re in a foreach loop, you can’t modify the collection. Use a regular for loop instead.
Tags: Pointer
Is this in .Net?
You can’t do that. When you’re in a foreach loop, you can’t modify the collection. Use a regular for loop instead.
References :