string jstr1 = R"({"result":{"lastestVersionComments":"","latestVersion":"V1.0.1.0B1.1001","statisticsTimeout":90,"heartBeat":43200,"reconnectInterval":-1,"priority":"-1"},"id":"2","jsonrpc":"2.0"})"; if (jstr1.find("latestVersion") != string::npos) { std::cout << jstr1.find("latestVersion") << endl; } if (jstr1.find("latestBoot") != string::npos) { std::cout << jstr1.find("latestBoot") << endl; } if (jstr1.find("latestConfiguration") != string::npos) { std::cout << jstr1.find("latestConfiguration") << endl;
要用npos不要用大于0