Stdio.h

Stdio.h

stdio.h, which stands for "standard input/output header", is the header in the C standard library that contains macro definitions, constants, and declarations of functions and types used for various standard input and output operations. The functionality descends from a "portable I/O package" written by Mike Lesk at Bell Labs in the early 1970s. [cite book|last=Kernighan|first=Brian|authorlink=Brian Kernighan|coauthors=Rob Pike|title=The UNIX Programming Environment|publisher=Prentice Hall|location=Englewood Cliffs|date=1984|pages=pg. 200] C++, for compatibility reasons, includes stdio.h as well as an essentially equivalent header, cstdio.

Functions declared in stdio.h are extremely popular, since as a part of the C standard library, they are guaranteed to work on any platform that supports C. Applications on a particular platform might, however, have reasons to use the platform's I/O routines, rather than the stdio.h routines.

Example usage

All functions in C (and its many derivatives) are declared in header files. Thus, programmers have to include the stdio.h header in the source code in order to use the functions declared in it.


#include int main(void){ int ch; while ((ch = getchar()) != EOF) putchar(ch); putchar(' '); return 0;}

The above program reads all input from standard input and echoes it to standard output, byte by byte, adding a newline at the end of its output.

Member functions

Functions declared in stdio.h can generally be divided into two categories: the functions for file manipulation and the functions for input-output manipulation.

Member types

Data types defined in the stdio.h header include:
* FILE - a structure containing the information about a file or text stream needed to perform input or output operations on it, including:
** a file descriptor
** the current stream position
** an end-of-file indicator
** an error indicator
** a pointer to the stream's buffer, if applicable
* fpos_t - a non-array type capable of uniquely identifying the position of every byte in a file.
* size_t - an unsigned integer type which is the type of the result of the sizeof operator.

ee also

*Large file support

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Stdio.h — Стандартная библиотека языка программирования С assert.h complex.h ctype.h errno.h fenv.h float.h inttypes.h iso646.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stdbool.h stddef.h stdint.h stdio.h stdlib.h …   Википедия

  • Stdio.h — Saltar a navegación, búsqueda stdio.h, que significa standard input output header (cabecera estandar E/S), es la biblioteca estándar del lenguaje de programación C, el archivo de cabecera que contiene las definiciones de macros, las constantes,… …   Wikipedia Español

  • stdio.h — stdio.h, que significa standard input output header (cabecera estandar E/S), es la biblioteca estándar del lenguaje de programación C, el archivo de cabecera que contiene las definiciones de macros, las constantes, las declaraciones de funciones… …   Wikipedia Español

  • Stdio.h — <stdio.h>, pour Standard Input/Output Header ou En tête Standard d Entrée/Sortie , est l en tête de la bibliothèque standard du C déclarant les macros, les constantes et les définitions de fonctions utilisées dans les opérations d… …   Wikipédia en Français

  • stdio.h — Стандартная библиотека языка программирования С assert.h complex.h ctype.h errno.h fenv.h float.h inttypes.h iso646.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stdbool.h stddef.h …   Википедия

  • STDIO — Standard Input/Output …   Acronyms

  • STDIO — Standard Input/Output …   Acronyms von A bis Z

  • STDIO.H — comp. abbr. Standard Input/Output Header (C Programming Language) …   United dictionary of abbreviations and acronyms

  • Dao (programming language) — Infobox programming language name = Dao paradigm = Multi paradigm year = 2006 designer = Limin Fu latest release version = dao 1.0 preview latest release date = 2008 04 25 typing = statically typed or dynamically typed influenced by = C++, Lua,… …   Wikipedia

  • Comparison of programming languages (basic instructions) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”