How to check if a vector is NULL?

vector <int> test;

How to check if this is NULL?

if (test == NULL)

returns compiler errors.

Recommended Answers

All 3 Replies

Vectors use the empty method

vector <int> test;
if(test.empty()) ...

If i want check the house (forexample v[i]) that is empty or no and now what can i do?

s.rasoly, if you have a question please start your own thread, and not bump into a 3 year old one!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.