answersLogoWhite

0

Yes, at least as far as C++ is concerned. Although you wouldn't regard the keyboard as being a file, to C++ there is no difference between accepting input from a disk-based file or from the keyboard: they are both streams and therefore they are both files. The same logic applies to the console window or a printer with regards output streams. However, it's probably easier to think of a file stream as being an abstraction. The user can redirect input and output from the command line as they see fit, so the same code will operate regardless of where the input or output is physically directed. Thus a file stream can be regarded as being a conceptual file rather than an actual disk-based file.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

C plus plus reading and writing a file?

Use an input file stream (ifstream) to read from a file and an output file stream (ofstream) to write to a file. Both can be found in the <fstream> standard library header.


What are filestream classes in c plus plus?

The file stream classes (ifstream and ofstream) are derivatives of the I/O stream classes (istream and ostream) that are specific to file input and output.


Can you rewrite a cuda file in c c plus plus language?

Yes, you can rewrite a cuda program originally written in c in c plus plus.


How is file handling applied in c plus plus?

File handling is handled by input stream objects (ifstream) and output stream objects (ofstream), or bi-directional streams (fstream). These classes are derived from istream and ostream. See related links for more information on these classes.


Can you do projects in c and c plus plus?

Yes, you can do projects in C and in C++. Most compilers will recognize the source file by its extension, and adjust itself accordingly.


Can you read a file after created by a program in C plus plus?

Yes. You can either create a file for both reading and writing, or you can re-open a file for reading after creating and writing to it.


Why you use constreamh in c plus plus?

There is no such header in C++. You must consult the documentation provided with the file. It is most likely related to console input/output, perhaps providing enhancements to the standard I/O stream implementation.


How do you create .exe file in c plus plus?

You can create an exe-file from your C++ source, if you have a compiler.


How do you open a file in c plus plus?

fopen()


What is fwrite function in c language?

writes data to a FILE* stream.


Is there a file concept in c plus plus?

No. The standard does not define nor require a file concept.


What is a scatter file in c or c plus plus programming?

Scatter File is a linker script file used by RVCT/Keil for ARM processors. It is used by arm linker.