g*********s 发帖数: 1782 | 1 I have some code using stl container and algorithm to debug. Below is what I get:
tag is a vector with size 3, the content is 0, 1, 2.
(gdb) p tag.begin()
$3 = {_M_current = 0x8053008}
(gdb) p tag.end()
$4 = {_M_current = 0x8053014}
(gdb) p tag.size()
$5 = 3
(gdb) p (tag.end() - tag.begin())
Attempt to take address of value not located in memory.
Why "3" is not properly output?
(gdb) p std::find(tag.begin(), tag.end(), 2)
No symbol "find" in namespace "std". |
|