string的find函数,返回下标,当不存在时返回string::npos,为无符号数最大值
来源:互联网 发布:aes java代码 编辑:程序博客网 时间:2024/04/30 14:28
#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;}
运行结果——
0 0
- string的find函数,返回下标,当不存在时返回string::npos,为无符号数最大值
- string的find函数返回值和string::npos 的理解
- std::string::find 空字符串 返回结果不是 string::npos
- C++函数返回指针或引用实例,string.find()与string::npos实例
- find 函数和string :: npos 的用法
- c++ string类length()(size())函数返回值--无符号数
- string中的find函数和string::npos的使用
- string::find string::npos
- std::string的find返回值为string::size_type
- string::npos表示不存在的位置
- 注意sizeof()返回的数无符号数,有符号数遇到无符号数时变成无符号数
- string::find 与 string::npos
- string类find函数返回值判定
- string类find函数返回值判定
- string类find函数返回值判定
- C++中string::find()函数和string::npos函数的使用
- C++中string.find()函数与string::npos
- C++中string.find()函数与string::npos
- 恭喜我开通了CSDN博客
- eclipse查看jar包源代码乱码问题解决
- Python ==运算符重载
- Oracle “CONNECT BY” 使用
- mysql忘记root密码&新建用户&新建数据库&赋予权限
- string的find函数,返回下标,当不存在时返回string::npos,为无符号数最大值
- Ubuntu 默认启动到命令行 12.04
- cocos2dx建初始项目
- hazelcast集群配置
- SearchView
- opencv实现图像邻域均值滤波、中值滤波、高斯滤波
- Windows下的修改Tomcat的可用内存
- .net Global中的所有事件
- 黑马程序员_对象的简单分析_对象与函数参数_常见错误