Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
500 views
in Computer by (25.0k points)

What are input and output streams?

1 Answer

+1 vote
by (26.0k 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.0k points)
0 votes
1 answer
asked Mar 30, 2020 in Computer by Ranveer01 (26.0k 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

...