Solved Search vector for a value

Custom / CUSTOM
August 6, 2011 at 05:56:26
Specs: Windows 7, 8g
Hi all.

I am new to vectors and links and I am having trouble with using the find and find_if functions. I want to search my list and see if var1 already exists in the list. My psedocode is below. Any help or tutorials your can provide will be very useful. Thanks.

if(var1 not in list)
add to list

See More: Search vector for a value

Report •

August 6, 2011 at 06:06:24
✔ Best Answer
if (std::find(list.begin(), list.end(), var1) != var1)

How To Ask Questions The Smart Way

Report •
Related Solutions

Ask Question