File Handling: The FILE Object and <fstream>
Quiz yourself by thinking what should be in
each of the black spaces below before clicking
on it to display the answer.
Help!
|
|
||||
---|---|---|---|---|---|
File mode that opens or create a text file in writing mode w r a x | show 🗑
|
||||
Reads a character from a file: getc() fclose() puc() fopen() | show 🗑
|
||||
It is created for the permanent storage of data. Variable Constant File List | show 🗑
|
||||
show | Gets a character, put it into a file pointer until an enter is pressed
🗑
|
||||
Refers to the name of the file File pointer Filename file extension file attribute | show 🗑
|
||||
Writes a set of data to a file fprintf() fclose() fopen() *fp | show 🗑
|
||||
show | FILE *fp;
🗑
|
||||
What is the correct syntax for fclose()? FCLOSE(fp); Fclose(fp); fclose(fp); fclose(“fp”); | show 🗑
|
||||
show | End of file
🗑
|
||||
Writes a character to a file: fclose() fopen() puc() getc() | show 🗑
|
||||
show | <<
🗑
|
||||
Which of the following header file is required for creating and reading files? ifstream stream fstream ofstream | show 🗑
|
||||
Which of the following is used to create a stream that performs both input and output operations? fstream ifstream iostream ofstream | show 🗑
|
||||
A C++ library that allows working with files fstream cstdlib ctype cmath | show 🗑
|
||||
show | #include<fstream>
🗑
|
||||
Which stream class is used to both read and write on files? ofstream fstream ofstream opstream | show 🗑
|
||||
Which stream class is to only read from files? iostream ofstream fstream ifstream | show 🗑
|
||||
show | getline
🗑
|
||||
It represents a sequence of bytes on the disk where a group of related data is stored. Array Parameter Variable File | show 🗑
|
||||
show | Text
🗑
|
||||
show | Append
🗑
|
||||
A function directly writes into the file: fscanf() fprintf() fopen() fclose() | show 🗑
|
||||
show | fp = fopen("one.txt", "w");
🗑
|
||||
show | Append
🗑
|
||||
show | ofstream
🗑
|
||||
Which of the following is used to create a stream that performs both input and output operations? iostream ofstream ifstream fstream | show 🗑
|
||||
show | ofstream
🗑
|
||||
The ifstream would be used when: appending a file creating a file reading a file removing a file | show 🗑
|
||||
show | bool
🗑
|
||||
Which header file is required to use file I/O operations? <ostream> <iostream> <ifstream> <fstream> | show 🗑
|
||||
show | After pressing return key
🗑
|
||||
What is the output of the given program? #include < iostream > using namespace std; int main () { char str[] = "Steve jobs"; int val = 65; char ch = 'A'; cout << val << endl; return 0; } 65 A a Error 65 | show 🗑
|
Review the information in the table. When you are ready to quiz yourself you can hide individual columns or the entire table. Then you can click on the empty cells to reveal the answer. Try to recall what will be displayed before clicking the empty cell.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.
Normal Size Small Size show me how
Normal Size Small Size show me how
Created by:
Easy Kwatro
Popular Computers sets