字符串:
名人:
#include <iostream>
#include <string>
using namespace std;
string::size_type findStringPos(string str, string findStr)
{
if (str.empty() && findStr.empty())
return 0;
string::size_type pos = str.find_first_of(findStr);
return pos;
}
int main() {
string strA("ABC DEF GHI JKl");
string strB("DEF");
cout<<"pos = "<<findStringPos(strA, strB)<<endl;
return 0;
}
里面的string::size_type findStringPos(string str, string findStr)
是什么用法,能详细给解释一下吗,谢谢!