cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
checking vector size
checking vector size
Feb 21, 2012 at 5:29pm UTC
fabiolanza
(11)
guys,
i have a vector and i am implementing it with push_back() function. how can i check the size of that vector later?
because i am using the function size() and it`s returning me segmentation fault
any hints?
thanks
Feb 21, 2012 at 5:52pm UTC
Athar
(4466)
size() is the right function. If you get a segmentation fault, you're messing up somewhere else.
Feb 21, 2012 at 7:52pm UTC
viliml
(791)
post us the code.
Feb 21, 2012 at 7:55pm UTC
ciphermagi
(807)
Segmentation faults happen a lot when you're trying to access an element outside of the bounds of a container. Are you attempting to access the element at .end()?
Topic archived. No new replies allowed.