Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.

File Handling: The FILE Object and <fstream>

        Help!  

Question
Answer
File mode that opens or create a text file in writing mode w r a x   w  
🗑
Reads a character from a file: getc() fclose() puc() fopen()   getc()  
🗑
It is created for the permanent storage of data. Variable Constant File List   File  
🗑
Output is? while( (ch = getchar()) != '\n') { putc(ch, fp); } Puts character into a variable Gets a character until enter key is pressed Gets a character, put it into a file pointer until an enter is pressed Gets a character   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   Filename  
🗑
Writes a set of data to a file fprintf() fclose() fopen() *fp   fprintf()  
🗑
What is the correct syntax for declaring a file pointer? file *fp; *FILE *fp; FILE *fp; File *fp;   FILE *fp;  
🗑
What is the correct syntax for fclose()? FCLOSE(fp); Fclose(fp); fclose(fp); fclose(“fp”);   fclose(fp);  
🗑
EOF means ______________________________ End of format End of float End of function End of file   End of file  
🗑
Writes a character to a file: fclose() fopen() puc() getc()   putc() // However, it is marked wrong. It is also not getc().  
🗑
Which operator is used to insert the data into the file? << >> < >   <<  
🗑
Which of the following header file is required for creating and reading files? ifstream stream fstream ofstream   fstream  
🗑
Which of the following is used to create a stream that performs both input and output operations? fstream ifstream iostream ofstream   fstream  
🗑
A C++ library that allows working with files fstream cstdlib ctype cmath   fstream  
🗑
Which header file is used for reading and writing to a file? #include<iostream> #include<cmath> #include<fstream> #include<conio>   #include<fstream>  
🗑
Which stream class is used to both read and write on files? ofstream fstream ofstream opstream   fstream  
🗑
Which stream class is to only read from files? iostream ofstream fstream ifstream   ifstream  
🗑
What can be used to input a string with blank space? getline inline sideline putline   getline  
🗑
It represents a sequence of bytes on the disk where a group of related data is stored. Array Parameter Variable File   File  
🗑
By default, all the files in C++ are opened in _________ mode. Octal ASCII Text Binary   Text  
🗑
An operation where in data is added to the existing data of file Delete Create Close Append   Append  
🗑
A function directly writes into the file: fscanf() fprintf() fopen() fclose()   fprintf()  
🗑
What is correct syntax for fopen()? fp = fopen(one.txt, w); fp = fopen("one.txt", "w"); fp = fopen(one.txt, "w"); fp = fopen(“one.txt”, w);   fp = fopen("one.txt", "w");  
🗑
An operation wherein data is added to the existing data of a file Combine Concatenate Append Add   Append  
🗑
Which of the following is used to create an output stream? iostream ofstream fstream ifstream   ofstream  
🗑
Which of the following is used to create a stream that performs both input and output operations? iostream ofstream ifstream fstream   fstream  
🗑
Which stream class is to only write on files? opstream ifstream ofstream fstream   ofstream  
🗑
The ifstream would be used when: appending a file creating a file reading a file removing a file   reading a file  
🗑
What is the return type open() method? double int char bool   bool  
🗑
Which header file is required to use file I/O operations? <ostream> <iostream> <ifstream> <fstream>   <fstream>  
🗑
When will the cin can start processing of input? Delete file Both read and write file After pressing return key By pressing backspace   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   65  
🗑


   

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.

 
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
Created by: Easy Kwatro
Popular Computers sets