7.6 Records and Files Flashcards
What are the important steps to change the contents of a file?
- Open the file
- Read/write to the file
- Close the file
What is a data structure?
A collection of elementary data types such as integer, real, Boolean, char or string
Array data structure
Can hold items of an identical type
Record data structure
A data structure consisting of a number of fields which can all be of different types
What is a field?
A single tiem of data in a record
What is a file?
A data structure that can store a collection of records
What are the 3 modes a file can be opened in?
- Write mode
- Append mode
- Read mode
Write mode
Allows writing to a file
Append mode
Allows more data to be added to a file
Read mode
Only allows the file to be read
What needs to be assigned to the identifier for the file to be used in the program?
- Actual file name
- Path