我们在C++中使用的find函数一般都是algorithm库里面提供的或者
是STL容器里面的find函数。今天就来总结一下他们的使用与区别
1. 容器里面的find函数
STL里面容器除了vector其他常见的容器都有自己实现成员函数find,例如string中的find函数,string的find()函数用于找出字母在字符串中的位置。
函数原型如下:
//(1)
size_type find (const basic_string& str, size_type pos = 0) const noexcept;
//(2)
size_type find (const charT* s