[問題] 關於string 的 find 函數
網頁上的範例
string str1="There are two needles in this haystack with needles.";
string str2="needle";
size_t found;
found=str.find(str2);
if(found!=string::npos)
cout<<"first 'needle' found at: "<<int(found)<<endl;
到這邊我都還看的懂
found=str.find("needles are small",found+1,6)
if(found!=string::npos)
cout<<"second 'needle' found at: "<<int(found)<<endl;
這個我就看不懂了
他的 "needles are small",found+1,6 是哪裡來的...
三格的用處分別是什麼
謝謝指教
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.123.5
推
10/30 18:50, , 1F
10/30 18:50, 1F
→
10/30 18:54, , 2F
10/30 18:54, 2F
→
10/30 18:57, , 3F
10/30 18:57, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章