Last element in vector

Feb 28, 2014 at 12:11am
Is there a way to say "while the value stored in the last element in the vector is greater than 9" in C++?
Last edited on Feb 28, 2014 at 12:11am
Feb 28, 2014 at 12:15am
1
2
3
4
while (v.back() > 9)
{
    // ...
}


http://www.cplusplus.com/reference/vector/vector/back/
Feb 28, 2014 at 12:17am
thanks!
Topic archived. No new replies allowed.