Last element in vector

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
1
2
3
4
while (v.back() > 9)
{
    // ...
}


http://www.cplusplus.com/reference/vector/vector/back/
thanks!
Topic archived. No new replies allowed.