首页 新闻 赞助 找找看

C++ string类 find 函数

0
悬赏园豆:5 [已关闭问题] 关闭于 2014-02-04 10:42

读不懂函数原型:

size_type find (const basic_string& str,size_type pos=0)const noexcept;

size_type find(const charT* s,size_type pos,size_type n) const;

Neverland1995的主页 Neverland1995 | 初学一级 | 园豆:200
提问于:2014-01-28 10:51
< >
分享
所有回答(3)
0

第一个:从pos位置起开始查找匹配的字符串,返回第一个匹配位置

第二个我也没用过

Kee_Chen | 园豆:240 (菜鸟二级) | 2014-05-12 15:59
1

int find(char c, int pos = 0) const;//从pos开始查找字符c在当前字符串的位置
int find(const char *s, int pos = 0) const;//从pos开始查找字符串s在当前串中的位置
int find(const char *s, int pos, int n) const;//从pos开始查找字符串s中前n个字符在当前串中的位置
int find(const string &s, int pos = 0) const;//从pos开始查找字符串s在当前串中的位置

Hexa33 | 园豆:169 (初学一级) | 2014-05-28 14:04
0

一楼正解

楚兴 | 园豆:161 (初学一级) | 2015-02-22 22:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册