FACTOID # 158: 84% of people in Finland feel that they are at a low risk of experiencing a burglary - but just look at how many burglaries they have!
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Standard output

The standard streams are a set of input and output channels featured in Unix and Unix-like operating systems, and provided by the standard I/O library ('stdio.h') of the C programming language. They consist of three channels through which data can be passed to or from a program:

Contents

Standard input

Standard input is the input stream into which text or other data can be entered into a program. Certain programs will, by default, use the standard input stream as a data source if not given a file to use as input. The file descriptor for standard input is 0.


Standard output

Standard output is the output stream into which data are written from a program. Data written to standard output are usually written to the screen unless redirected. It is intended to be the used as the default output stream. The file descriptor for standard output is 1.


Standard error

Standard error is the output stream used by programs for outputting error messages or other diagnostics. It is a separate stream from standard output and can be redirected separately from it. The file descriptor for standard error is 2.


Relevance to the C programming language

The C standard library header file <stdio.h> defines three variables of type FILE * which programs can use to access the standard streams. They are named 'stdin', 'stdout' and 'stderr' respectively.


When running programs from a terminal, standard input is taken from the keyboard, while standard output and error will appear on the screen.


Because of the ubiquity of C and especially its use when programming system software for any operating system, these standard streams are present, or simulated, in many operating systems, whether they're Unix-like or not.


  Results from FactBites:
 
CLHS: Variable *DEBUG-IO*, *ERROR-OUTPUT*... (518 words)
The value of *standard-input*, called standard input, is a stream that is used by many operators as a default source of input when no specific input stream is explicitly supplied.
The value of *standard-output*, called standard output, is a stream that is used by many operators as a default destination for output when no specific output stream is explicitly supplied.
The value of *trace-output*, called trace output, is the stream on which traced functions (see trace) and the time macro print their output.
Standard Input, Standard Output, and Standard Error (2189 words)
In addition to the standard input and standard output, commands often produce other types of output, such as error or status messages known as diagnostic output.
In the example, the output of the ls command is the input for the pg command.
In the example, the output of the ls command is the input for the grep command.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.