#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
using namespace std;
int main( void )
{
string str("abc");
string::size_type i = str.find( "d" );
cout << "i=" << i << endl;
cout << "string::npos=" << string::npos << endl;
// 此时i = npos = 4294967295,无符号数最大值
unsigned int j = 0xffffffff;
cout << "j=" << j << endl;// j = i = npos;
return 0;
}
运行结果——