概念理解
.npos是一个常数,表示size_t的最大值(Maximum value for size_t)。许多容器都提供这个东西,用来表示不存在的位置 #include <iostream>
#include <limits>
#include <string>
using namespace …
string::npos 的作用
string::npos 的意思:The constant is the largest representable value of type size_type. It is assuredly larger than max_size(); hence it serves as either a very large value or as a special code.
大致意思 是一个常量, 是size_type类型,是一…