std::ifstream inFile; std::ofstream outFile; // ... outFile << inFile.rdbuf();
I was writing one file into another with rdbuf, everything was