answersLogoWhite

0

The term stream is a generic abstraction that says nothing about the implementation. However, if we use the analogy that gave it its name, a stream of water, we can better understand how a stream works. A water stream allows water to flow from one point to another in one direction only (downstream, with the flow of the current). If we were to throw a stick into the water, it would be carried downstream by the water where it could then be extracted. Sticks can be inserted or extracted automatically by devices, thus allowing information to pass between those devices.

A file stream is a stream that is associated with a device representing a file. If the file is upstream then we can use the stream to extract information from the file. When we extract information from a stream, that stream is known as an input stream; it provides us with information. Conversely, if the file were downstream then we can use the stream to insert information into the file. When we insert information into a stream, that stream is known as an output stream; it carries information away from us.

An input/output stream is one where we can both insert and extract information. An input/output file stream is a typical example: we can extract data from the file associated with the stream, process the data (modify it in some way), and then insert the modified data back into the same file. To implement an input/output stream, we simply use two streams associated with the same device: one specifically for input operations, the other specifically for output operations. This implementation detail is hidden from the user, so the stream appears to be a bi-directional stream as far as the user is concerned.

User Avatar

Wiki User

8y ago

Still curious? Ask our experts.

Chat with our AI personalities

BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
BeauBeau
You're doing better than you think!
Chat with Beau
More answers

An input/output stream is simply a stream that you can extract data from and/or insert data to. In other words you can both read and write to the stream.

User Avatar

Wiki User

11y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What are input output streams in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Input output function in c plus plus?

input is the << operator and output is the >> operator


What is the Streaming data in the context of C plus plus refers to what?

Streams provide a unified, generic, input/output mechanism in C++. They allow a consistent method of inserting or extracting data from any physical storage medium that supports a stream implementation, such as a filestream or a stringstream, without the need to know the details of that medium. All streams operate in exactly the same way. To extract data from an input stream, use the extraction operator (>>). To insert data into a stream, use the insertion operator (<<). Some streams are omni-directional (input-only or output-only), while others are bi-directional (both input and output).


What are the basic input and output of c and c plus plus?

That is STANDARD input and STANDARD output. By default, standard input is the keyboard, and standard output is the screen. Standard I/O is set by the operating system, though it may be redirected by script invocation or system commands within the C/C++ program itself. You could, for instance, set standard output to a printer or a file in lieu of a screen. You should also Google Standard Error.


What is iosteram in c plus plus?

The <iostream> include file is a header file that contains the prototype declarations of functions that provide the basic input/output mechanisms in C++. The <iostream> header file sets up the objects that initialize the basic input/output pathways, cout and cin.


Which code i need to delete middle digit in 3 digit number in c plus plus?

If you know that the number input will always be three digits: output = 10 * (int)(input / 100) + (input % 10); If you want to idiot proof it (eg. too many digits): output = 10 * (int)((input % 1000) / 100) + (input % 10);