Export (0) Print
Expand All
Expand Minimize


An unsigned integral value initialized to –1 that indicates either "not found" or "all remaining characters" when a search function fails.

static const size_type npos = -1;

When the return value is to be checked for the npos value, it might not work unless the return value is of type size_type and not either int or unsigned.

See the example for find for an example of how to declare and use npos.

Header: <string>

Namespace: std

© 2014 Microsoft