how to check whether a vector is empty or not code example Example: if vector is empty c++ v.empty() // returns true if vector v is empty