answersLogoWhite

0


Best Answer

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

7y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

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.

This answer is:
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);

Related questions

What is stream operator in c plus plus?

There are two stream operators: << (insert or put) and >> (extract or get). Output streams implement the insertion operator, input streams implement the extraction operator and input/output streams implement both operators.


What is the header for basic input or output in C Plus Plus?

For basic input and output in C++: #include


Input output function in c plus plus?

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


What is used to output data in c plus plus?

You use output devices or streams, typically console screens, printers and files.


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 is console application in c sharp?

The console application in C sharp(C#) is a simple application which takes input and returns output on a command line console, with the following data streams: standard input, standard output, and standard error.


What is file handling in c and c plus plus or objective c?

File handling is simply the process of opening, reading, writing and closing files. Files are simply streams for input and output, or the "serialisation" of objects. In other words, reading and writing data to and from disk storage.


What are the cout and cin identifiers in C and what are they used for?

std:cin and std:cout are the standard console input and output streams, respectively. By default, input is redirected from the console keyboard and output redirected to the console screen. However, both streams can be redirected from the command line. This not only allows input and output to be redirected from disk files but also permits the output of one program to be redirected as input to another, allowing two or more programs to be chained together (assuming the output of one program is in the exact format required as input to the next).


Is cin an output identifier in c plus plus?

No. In C++ with <iostream>, cin is a prefedined class that represents stdin, so it is an input identifier.


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 are different input and output functions in C?

The C programming language provides many standard library functions for file input and output. These functions make up the bulk of the C standard library header <stdio.h>. The I/O functionality of C is fairly low-level by modern standards; C abstracts all file operations into operations on streams of bytes, which may be "input streams" or "output streams". Unlike some earlier programming languages, C has no direct support for random-access data files; to read from a record in the middle of a file, the programmer must create a stream, seek to the middle of the file, and then read bytes in sequence from the stream.


What are file modes in c plus plus?

I guess you mean either input/output/inout/append or binary/text.