C++ homework: 1.If you want to open a file with more than one ios flag, you can
ID: 3722718 • Letter: C
Question
C++ homework:
1.If you want to open a file with more than one ios flag, you can join 2 or more flags using the ___ character.
2.ifstream allows which of the following:
read files
modify files
create new files
write files
3.Match each ios error state bit to when it occurs:
ios::eofbit
ios::failbit
ios::hardfail
ios::goodbit
A.end of input stream
B.attempted operation fails
C.unrecoverable error
D.default value
4. The methods seekp and seekg are used with ____ access files
5.If a file already exists and you want to add new data to it, which ios flag would you use?
ios::trunc
ios::app
ios::out
ios::in
6.Match each method to its purpose:
seekp
seekg
tellp
tellg
A.moves the write position
B.moves the read position
C.returns the write position
D.returns the read position
7.Member functions for reading and writing files(match)
getline
get
put
write
A.allows input of data that contains spaces
B.reads a single character
C.writes a single character
D.writes binary data
8.fstream allows which of the following:
create new files
modify files
write files
read files
9. If you want to open a file for both input and output you would use an ____ file.
10. ofstream allows which of the following:
write files
read files
create new files
modify files
Explanation / Answer
ios::eofbit ----- A.end of input stream
ios::failbit ---- B.attempted operation fails
ios::hardfail ---- C.unrecoverable error
ios::goodbit ----- A.end of input stream
seekp ----A.moves the write position
seekg---- B.moves the read position
tellp ---- C.returns the write position
tellg ----D.returns the read position
getline ----- A.allows input of data that contains spaces
get ---- B.reads a single character
put ---- C.writes a single character
write --- D.writes binary data
write files
read files
binary file
write files
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.