LIVE Course for free

Rated by 1 million+ students
Get app now
0 votes
754 views
in Computer by (25.7k points)

What are input and output streams?

1 Answer

+1 vote
by (26.4k points)
selected by
 
Best answer

The input streams are sequence of characters that move from input device like keyboard to the program/computer. The output streams are sequence of characters that move from program/computer to an output device like monitor.

The stream classes supported by C++ for file input and output:

1. fstreambase:

class provides facilities for file operations and consists of open() and close() member functions. This is base class for fstream, ifstream and ofstream.

2. Ifstream:

class supports read operations and consists of open () with default input mode and inherits function get(), getline, read() , seekg(), tellg() from istream class defined inside iostream.h file.

3. ofstream:

class supports output operations and consists of open() with default output mode. It inherits the function put(), write(), seekp() and tellp() from ostream.

4. fstream():

class supports both input and output operations. It contains open() with default input mode and inherits all the functions from istream and ostream classes through iostream. filebuf class sets the file buffer to read and write.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 30, 2020 in Computer by Ranveer01 (26.4k points)
0 votes
1 answer
asked Mar 30, 2020 in Computer by Ranveer01 (26.4k points)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...