首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

C++标准库中的find()函数如何调用

2013-01-08 
C++标准库中的find()函数怎么调用?我写了一段代码://value well look forint search_value 42std::vec

C++标准库中的find()函数怎么调用?
我写了一段代码:


//value we'll look for
int search_value = 42;
std::vector<int> vec;
vec.push_back(42);
vec.push_back(40);
vec.push_back(41);
//call find to see if that value is present
std::vector<int>::const_iterator result = find(vec.begin(),vec.end(),search_value);

在编译的时候报出错误:
Error1error C3861: 'find': identifier not found
请问怎么解决呢?
[解决办法]
#include<algorithm>

std::find

热点排行