File Processing Flashcards
Files are used for data persistence which is…
Permanent retention of data
How do computers store files?
Secondary storage devices
What is a file?
A sequence of bytes
Files end with
End-of-file marker
Or
Specific byte number recorded in data structure
What happens when a file is opened?
An object is created with associated stream
Which headers must be included for file processing?
<iostream> and <fstream>
</fstream></iostream>
<fstream>'s typedef aliases enables....
</fstream>
char output to files
C++ structure on file
Not imposed
When an ____________ object is created, a file can be opened for output
ofstream
What happens to existing files opened with iOS::out?
They are truncated
How can you add to the end of a file?
ios::app
ofstream objects must be created while opening a file
No, it can be attached later
What does overloaded operator ! do for a stream?
Determines if it is opened correctly
What is the failbit for cin?
End-of-file indicator
How can you close a stream object?
Use close member function or stream object’s destructor