need to ask quick question about stl linked lists.
When i push objects into a list am i correct in saying that on each push
"new" objects are created i.e. the linker fixes addresses for those objects in the container.
While the address for those objects in the container are different the value they hold are "copied" from the object that was pushed in.
So if i have
the member variable a for the new objects in the list would have the value 10 unless changed.
int a ;
a =10 ;
myClass a ;
list <myClass> ;
So is my logic flawed?
Sorry for this ridiculous question. I had to use linked lists all of a sudden, so have to read it on my own.
The main question though is the erase function using an iterator.
why do we need to initialize it to myClass.erase()
it= myClass.erase() ;
what does erase() return?
would not do if we just increment it?
in a hurry, sorry if formatting is bad.
Thanks in advance