What does string::npos mean in this code?

后端 未结 12 1251
傲寒
傲寒 2020-11-30 18:50

What does the phrase std::string::npos mean in the following snippet of code?

found = str.find(str2);

if (found != std::string::npos)
    std::         


        
12条回答
  •  北海茫月
    2020-11-30 19:18

    size_t is an unsigned variable, thus 'unsigned value = - 1' automatically makes it the largest possible value for size_t: 18446744073709551615

提交回复
热议问题