It means not found.
It is usually defined like so:
static const size_t npos = -1;
It is better to compare to npos instead of -1 because the code is more legible.
More Related Contents:
- std::string formatting like sprintf
- Converting std::string from const_iterator to char*?
- Iterator invalidation rules for C++ containers
- How to trim a std::string?
- How to convert an instance of std::string to lower case
- Alternative to itoa() for converting integer to string C++? [duplicate]
- Does “&s[0]” point to contiguous characters in a std::string?
- How to concatenate a std::string and an int
- How do you construct a std::string with an embedded null?
- char* vs std::string in c++ [closed]
- How to implode a vector of strings into a string (the elegant way)
- How do you convert a C++ string to an int? [duplicate]
- Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’
- Forward declare a standard container?
- How do you append an int to a string in C++? [duplicate]
- How to get the number of characters in a std::string?
- C++ std::vector vs array in the real world
- Can a std::string contain embedded nulls?
- How do you convert CString and std::string std::wstring to each other?
- Why don’t the std::fstream classes take a std::string?
- I want to convert std::string into a const wchar_t *
- Assign a nullptr to a std::string is safe?
- convert a char* to std::string
- Why is the STL so heavily based on templates instead of inheritance?
- std::lexical_cast – is there such a thing?
- Legal to overwrite std::string’s null terminator?
- C++: how to get fprintf results as a std::string w/o sprintf
- Concatenating strings doesn’t work as expected [closed]
- c++ integer->std::string conversion. Simple function?
- Append int to std::string