checking vector size

Feb 21, 2012 at 5:29pm
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
size() is the right function. If you get a segmentation fault, you're messing up somewhere else.
Feb 21, 2012 at 7:52pm
post us the code.
Feb 21, 2012 at 7:55pm
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.