Код: Выделить всё
#include
#include
using namespace std;
int main() {
char s[100] = "\0";
// create a new file with 1234567890
fstream fs("data.bin", ios::in | ios::out | ios::trunc);
fs.write("1234567890", 10);
fs.close();
fs.open("data.bin", ios::in | ios::out | ios::app);
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79134760/tellg-does-not-move-to-the-end-even-after-writing-in-iosapp-mode[/url]
Мобильная версия