新手请问什么是string:npos
新手请教什么是string::npos。bool URLData::extract(const char* theData){assert(theData)string theURL
新手请教什么是string::npos。
bool URLData::extract(const char* theData)
{
assert(theData);
string theURL(theData);
if (theURL.find("TP:") == string::npos)
{
return false;
}
return true;
}
请问if (theURL.find("TP:") == string::npos)这个语句是要判断什么?
[解决办法]
[解决办法]简单点就是找不到"TP:"就return false