Примечание: я считаю себя начинающим программистом, поэтому постарайтесь не заходить слишком далеко
Пример того, как я записываю строку в файл:
string file_hex("huge_a**_string_goes_here_or_in_separate_cpp");
ofstream file_out;
file_out.open("tools\\c.exe", ios::binary | ios::trunc);
string res;
res.reserve(file_hex.size() / 2);
for (int i = 0; i < file_hex.size(); i += 2)
{
std::istringstream iss(file_hex.substr(i, 2));
int temp;
iss >> std::hex >> temp;
res += static_cast(temp);
}
file_out
Подробнее здесь: https://stackoverflow.com/questions/168 ... -truncated
Мобильная версия