how to check vector is empty at index c++ code example Example: if vector is empty c++ v.empty() // returns true if vector v is empty