Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

if vector contains value c++

#include <algorithm>

if(std::find(v.begin(), v.end(), x) != v.end()) {
    /* v contains x */
} else {
    /* v does not contain x */
}
 
PREVIOUS NEXT
Tagged: #vector
ADD COMMENT
Topic
Name
8+3 =