够详细了吧~~嘿嘿
int main(){
string str="show me the money show you the bomb";
string whatdoyoulookfor="show";
int index=0;
while(1){
index = str.find(whatdoyoulookfor,index);
if(index!=-1){
cout<<whatdoyoulookfor<<" is in "<<str<<" at "<<index<<endl;
index+=whatdoyoulookfor.length();
}else{
break;
}
}
}