Quantcast
Channel: User Zan Lynx - Stack Overflow
Viewing all articles
Browse latest Browse all 40

Answer by Zan Lynx for Using vector::data() chaining with member function print differnet values as pointer arithmetic

$
0
0

You returned a temporary copy of your vector. After the statement it is part of it is destroyed. If you wanted to keep it around you need to assign it to another vector.

So, you made a pointer to a temporary value which got erased. It no longer exists, and you're trying to point to pieces of its corpse.


Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>