Код: Выделить всё
#include
#include
int main() {
std::fstream file("test.txt", std::ios::in | std::ios::out);
// Read the key
const int key_size = 6;
char key[key_size + 1] = {0};
file.read(key, key_size);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79083979/stdfstream-cant-overwrite-content-after-read[/url]