About the vector find () question ~ ~ ~ Please enlighten heroes

Category: C/C++ -> C++ Author: ZEROLELOUCH Date: 2012-03-14 13:34:56
 
ZEROLELOUCH
2012-03-14 13:34:56
If I want to find the last position of the container element, then returns a pointer pointing to the last position (container name. End) value, but if you can not find it returns this value, ask is not my understanding is wrong? ? ? Thank you! ! !
possecat
2012-03-14 13:41:41
end return location is not the last element of a pointer. Is the last element pointer +1
celeron766
2012-03-14 13:54:10
find the last element in a position, should not be returned. End (), but a position before it, or the size () -1 that position.
zoezying
2012-03-14 14:01:11

positive solution
jinxing1985
2012-03-14 14:06:52
I'd never noticed (almost no vector), direct facie return value, if yes, then yes it ... ...
hefaxing
2012-03-14 14:26:34

Oh, thank you ah! ! ! Is the vector begin returns a pointer to the first element, and the end is the last element of the returned pointer +1 Is that right?
duzidengdaita
2012-03-14 14:44:15


Yes, is this.
wujun1234567890
2012-03-14 14:54:34


stl system, all used in a pair of iterators, are left-closed right-open, [begin (), end () ;)
wang171953
2012-03-14 15:06:22

that end () above what is stored ah?
yoyomuse
2012-03-14 15:19:33
end return location is not the last element of a pointer. Is the last element pointer +1
bslgh
2012-03-14 15:32:28
end save what: For example, the string 'ABC \ 0' then that is pointing to '\ 0' after something that you do not know what's
zhangzuizui
2012-03-14 15:40:09
end return is not the final position of an element, but the last one +1
duckliyawei
2012-03-14 15:52:04
end () iterator is a sentinel value that should not be, nor references.
lwsyq
2012-03-14 15:57:09
end () returns not the last one