char szContent[] = { '\x00','\x00', '\x3f','\x00','\xf0','\x80','\x00','\x3f','\x00','\xf0','\x00','\x3f','\x00','\xf0' };
std::string strContent;
for (int i = 0; i < sizeof(szContent); ++i)
{
strContent.push_back(szContent[i]);
}
char szKey[] = { '\x3f','\x00','\xf0','\x00' };
std::string strKey;
for (int i = 0; i < sizeof(szKey); ++i)
{
strKey.push_back(szKey[i]);
}
auto pos = strContent.find(strKey); //返回7
cout << pos << endl;