Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Standard streams
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Standard input (stdin)==<!-- This section is linked from [[COMMAND.COM]] --> Standard input is a stream from which a program reads its input data. The program requests data transfers by use of the ''read'' operation. Not all programs require stream input. For example, the ''[[dir (command)|dir]]'' and ''[[ls]]'' programs (which display file names contained in a directory) may take [[Command-line interface#Arguments|command-line arguments]], but perform their operations without any stream data input. Unless [[Redirection (computing)|redirected]], standard input is inherited from the parent process. In the case of an interactive shell, that is usually associated with the input device of a [[Computer terminal|terminal]] (or [[Pseudoterminal|pseudo terminal]]) which is ultimately linked to a user's [[Keyboard (computing)|keyboard]]. On [[POSIX]] systems, the [[file descriptor]] for standard input is 0 (zero); the [[POSIX]] <code><unistd.h></code> definition is <code>STDIN_FILENO</code>; the corresponding C <code><stdio.h></code> abstraction is provided via the <code>FILE* stdin</code> global variable. Similarly, the global C++ <code>std::cin</code> variable of type <code><iostream></code> provides an abstraction via [[Input/output_(C%2B%2B)#Input/output_streams|C++ streams]]. Similar abstractions exist in the standard I/O libraries of practically every [[programming language]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)