   String Help!
  Hello,I have a little question about strings. I've come acrossa little piece of code which i am curious about.- string::nposI know it means that something cannot be found- if word.find(letter) == string::nposWhat is this kind of syntax called? And what other types of this are there?* Thanx for any help!   
Quote:Original post by NUCLEAR RABBITHello,I have a little question about strings. I've come acrossa little piece of code which i am curious about.- string::nposI know it means that something cannot be found- if word.find(letter) == string::nposWhat is this kind of syntax called? And what other types of this are there?* Thanx for any help!size_t is a typedef corresponding to a type able to represent the size of any container or block of memory. string::npos is a value of type size_t that will never be a valid index for a string. Although it may vary from compiler to compiler, I would guess that string::npos would be the maximum value that can be represented by the size_t type (I could be wrong about this though).::npos is used as an argument to and return value from various string functions. In the case of the 'find' functions, if ::npos is returned it means the queried for item was not found.C++ and the standard library is well documented online; for example, in this case a google for 'std string', 'string find' or 'string npos' will turn up the above info plus a lot more.   