Wpis z mikrobloga

Jaka jest różnica dla opcji/flag ios::ate i ios::app dla metody .open() w klasie ofstream? Obydwie chyba robią to samo: ustaw pozycję początkową na koniec pliku i dopisuj nową zawartość.

ios::ate Set the initial position at the end of the file.
If this flag is not set, the initial position is the beginning of the file.
ios::app All output operations are performed at the end of the file, appending the content to the current content of the file.

#cpp #programowanie
  • 4
  • Odpowiedz
  • Otrzymuj powiadomienia
    o nowych komentarzach

@Narkan: ate come form 'at end' - it sets the stream position at the end of the file when you open it but you are free to move it around (seek) and write wherever it pleases you.

Masz rację. Tylko jak za pomocą seek() zmienić miejsce zapisu?
  • Odpowiedz