Chapters 6 & 7 Flashcards
What type is used to create userfiles?
FILE
If a file does not exist what does the append mode do?
Creates the file
T/F When testing files you cannot replicate some errors such as physically bad media in order to test it properly
True
What is considered auxiliary storage?
disk and tape
What are the three types of standard file streams?
stdin, stdout, stderr
Which C library contains the prototype statements for file operations
stdio.h
If a file is opened in “r” mode, C…
…opens the file for reading and sets the file marker at the beginning
If a file is not opened successfully C…
…continues processing with the next statement after the open
what specifies the type of data that is being formatted in formatted input/output
conversion codes
The two input functions that read text data and converts the data to the types specified by a format string are:
fscanf and scanf
T/F scanf implicitly casts data to match the conversion code and its corresponding address parameter.
False
which function reads the next character from the standard input stream and returns it value
getchar
what happens when scanf finds invalid data in the input stream
it terminates the scanf function and leaves the invalid character in the input stream
In a pretest loop is the condition tested before or after the statement is executed?
before
What are the 4 steps when working with a file
- Declare the file variable
- Open the file
- Use the file
- Close the file