用来返回某个字符在字符串中的位置,如果在字符串中没有这个字符,则返回-1
code:#includeusing namespace std; #include int main(){ string astr = "abc"; char ach = 'd'; int index = astr.find(ach); cout<

用来返回某个字符在字符串中的位置,如果在字符串中没有这个字符,则返回-1
code:#includeusing namespace std; #include int main(){ string astr = "abc"; char ach = 'd'; int index = astr.find(ach); cout<