Я получил программу, которая стандартно использует значение для строки.
Как я могу изменить его, чтобы пользователь мог ввести значение?
С наилучшими пожеланиями
Joriek
#include <iostream>
#include <string>
using namespace std;
int main()
{
std::string id_strnormal = "4a";
std::string code = "10 4a 00 11 22 33 44 55 66 77 88 99 10 03";
std::string start_str = code.substr(0, 2);
std::string id_str = code.substr(3, 2);
int str_length = code.length();
std::string stop_str = code.substr(str_length-5);
if (id_str == id_strnormal)
{
std::cout << code << std::endl;
}
if (id_str != id_strnormal)
{
std::cout << "package id isn't 4a" << std::endl;
}
system ("pause");
return 0;
}