Home
Explore
Exams
Search for anything
Search for anything
Login
Get started
Home
[CP 2] M7 - File Handling
Studied by 0 people
0.0
(0)
Add a rating
Learn
A personalized and smart learning plan
Practice Test
Take a test on your terms and definitions
Spaced Repetition
Scientifically backed study method
Matching Game
How quick can you match all your cards?
Flashcards
Study terms and definitions
1 / 44
Earn XP
Description and Tags
University/Undergrad
Add tags
45 Terms
View all (45)
Star these 45
1
Filename
Refers to the name of the file
New cards
2
fclose()
Closes a file
New cards
3
w
File mode that opens or create a text file in writing mode
New cards
4
65
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;
}
New cards
5
Gets a character, put it into a file pointer until an enter is pressed
What does the following code do?
while( (ch \= getchar()) !\= '\n') {
putc(ch, fp);
}
New cards
6
fprintf()
A function directly writes into the file:
New cards
7
Append
An operation wherein data is added to the existing data of a file
New cards
8
fp \= fopen("one.txt", "w");
What is correct syntax for fopen()?
New cards
9
File pointer
It points to a structure that contains about the file:
New cards
10
fstream
A C++ library that allows working with files
New cards
11
fstream
Which of the following is used to create a stream that performs both input and output operations?
New cards
12
fstream
Which stream class is used to both read and write on files?
New cards
13
After pressing return key
When will the cin can start processing of input?
New cards
14
writes to a file
What is meant by ofstream in c++?
New cards
15
fstream
Which stream class is used to both read and write on files?
New cards
16
bool
What is the return type open() method?
New cards
17
getline
What can be used to input a string with blank space?
New cards
18
65
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;
}
New cards
19
<<
Which operator is used to insert the data into the file?
\>>
<<
New cards
20
Gets a character, put it into a file pointer until an enter is pressed
What does the following code do?
while( (ch \= getchar()) !\= '\n') {
putc(ch, fp);
}
Gets a character, put it into a file pointer until an enter is pressed
Gets a character
Puts character into a variable
Gets a character until enter key is pressed
New cards
21
fgetc()
this function reads the character from the current pointer's positiona nd upon successful read moves the pointer to the next character in the file
New cards
22
fopen()
Writes a character to a file:
New cards
23
getc()
Reads a character from a file:
New cards
24
FILE *fp;
What is the correct syntax for declaring a file pointer?
New cards
25
fopen()
Creates a new file or open an existing file
New cards
26
a
File mode that opens a text file in append mode
New cards
27
text
By default, all the files in C++ are opened in \_________ mode.
New cards
28
ifstream
Which stream class is to only read from files?
New cards
29
Which header file is required to use file I/O operations?
New cards
30
reading a file
The ifstream would be used when:
New cards
31
fprint()
Writes a set of data to a file
New cards
32
fclose
It is the inverse of fopen, it breaks the connections between the file pointer and the external nam that was established by fopen
New cards
33
error
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;
}
New cards
34
is_open
Which member function is used to determine whether the stream object is currently associated with a file?
New cards
35
\#include
Which header file is used for reading and writing to a file?
New cards
36
fclose(fp);
What is the correct syntax for fclose()?
New cards
37
File
It is created for the permanent storage of data.
New cards
38
end of file
EOF means \______________________________
New cards
39
r
File mode that opens a text in reading mode
New cards
40
fstream
Which of the following header file is required for creating and reading files?
fstream
ifstream
ofstream
stream
New cards
41
<<
Which operator is used to insert the data into the file?
\>
\>>
<<
<
New cards
42
error
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;
}
New cards
43
ofstream
Which of the following is used to create an output stream?
iostream
ifstream
fstream
ofstream
New cards
44
ofstream
Which stream class is to only write on files?
New cards
45
file ata
sequence of bytes on the disk where a group of related data is stored
New cards
Explore top notes
Anatomy
Note
Studied by 310 people
359 days ago
5.0
(3)
Preview
🏘️
House + Home
Note
Studied by 6 people
476 days ago
5.0
(1)
Preview
How to get a Perfect Score on AP Euro DBQ
Note
Studied by 11 people
83 days ago
5.0
(1)
Preview
Administración - 3. Admin global, comparada y de calidad
Note
Studied by 64 people
38 days ago
5.0
(1)
Preview
Macbeth
Note
Studied by 89 people
993 days ago
5.0
(1)
Preview
😏
Chapter 13: Question Marks
Note
Studied by 88 people
620 days ago
5.0
(1)
Preview
Anirudh Mohanty - Honors Meiosis Notes
Note
Studied by 16 people
376 days ago
5.0
(1)
Preview
Spaced Repetition Research + Knowt Algo Planning
Note
Studied by 100 people
769 days ago
4.0
(1)
Preview
Explore top flashcards
Unit II - Congress
Flashcard (34)
Studied by 5 people
298 days ago
5.0
(1)
Preview
EXAM VI (QUIZ REVIEW)
Flashcard (30)
Studied by 4 people
656 days ago
4.5
(2)
Preview
Unit 1 AP Psych
Flashcard (220)
Studied by 2 people
103 days ago
5.0
(1)
Preview
Chem 11 Chapter 1
Flashcard (93)
Studied by 8 people
39 days ago
5.0
(1)
Preview
Woordenschat - Griekse en Latijnse woorden, woorddelen en uitdrukkingen
Flashcard (56)
Studied by 6 people
754 days ago
5.0
(1)
Preview
spanish
Flashcard (137)
Studied by 14 people
170 days ago
5.0
(1)
Preview
BIO 514 Unit 1 Content
Flashcard (254)
Studied by 51 people
168 days ago
5.0
(1)
Preview
Element 2 - Behaviourist approach
Flashcard (26)
Studied by 15 people
747 days ago
5.0
(1)
Preview