Actually in my case, I can't remember that because I was never taught or shown that at the beginning.
I literally just figured it out myself because I tried (++w) instead of (w++) and then it...
Type: Posts; User: MutantJohn
Actually in my case, I can't remember that because I was never taught or shown that at the beginning.
I literally just figured it out myself because I tried (++w) instead of (w++) and then it...
So basically, the first real line of output you show, I get. One points to 6 (that's r at the beginning) and then w points to the one right after it from w++.
My bag is, *(w++) = 1 and *r = 6 so...
I think what's confusing me the most is
*(w++) = *r;
In the beginning, r and w are equal to each other, the iterator returned from k.begin() and that's fine. I use begin() all the time.
...
Basically, lines 74 though 84 of the output are where I'm confused. I just printed the addresses and the values of them and they were both 1 in the block above but now suddenly in the original...
Here's the link : c++ - How to make elements of vector unique? (remove non adjacent duplicates) - Stack Overflow
I get that insert() returns a pair of <iterator, bool> which is fine so I get what...