FILE OPEN MODES File open modes n ios::app n ios::ate n ios::binary n ios::in n ios::out n ios::trunc n ios::nocreate n ios::noreplace

  • Published on
    20-Dec-2015

  • View
    214

  • Download
    1

Embed Size (px)

Transcript

  • Slide 1
  • Slide 2
  • FILE OPEN MODES
  • Slide 3
  • File open modes n ios::app n ios::ate n ios::binary n ios::in n ios::out n ios::trunc n ios::nocreate n ios::noreplace
  • Slide 4
  • ios::app Write all output to the end of file, no matter how you set the seekp pointer. ofstream: open file, write data to the end of file. ifstream: open file, read data from file. fstream: open file, write data to the end of file, BUT cannot read data from file. If the file does not exist, the program will create a new file.
  • Slide 5
  • Example Before Alex Zhao Andrew Nguyen Vincent Tran After Alex Zhao Andrew Nguyen Vincent Tran Tyler Price fstream File (myFile.txt, ios::app); File.seekp (0); File

Recommended

View more >