C Standard Library: Character Input and Output Functions
2013-03-20 22:49
316 查看
1.4 Character Input and Output Functions
int fgetc(FILE *stream)
fgetc returns the next character of stream as an unsigned char (converted to an
int), or EOF if end of file or error occurs.
char *fgets(char *s, int n, FILE *stream)
fgets reads at most the next n-1 characters into the array s, stopping if a newline is
encountered; the newline is included in the array, which is terminated by '\0'. fgets
returns s, or NULL if end of file or error occurs.
int fputc(int c, FILE *stream)
fputc writes the character c (converted to an unsigend char) on stream. It returns
the character written, or EOF for error.
int fputs(const char *s, FILE *stream)
fputs writes the string s (which need not contain \n) on stream; it returns nonnegative,
or EOF for an error.
int getc(FILE *stream)
getc is equivalent to fgetc except that if it is a macro, it may evaluate stream more
than once.
int getchar(void)
getchar is equivalent to getc(stdin).
char *gets(char *s)
gets reads the next input line into the array s; it replaces the terminating newline with
'\0'. It returns s, or NULL if end of file or error occurs.
int putc(int c, FILE *stream)
putc is equivalent to fputc except that if it is a macro, it may evaluate stream more
than once.
int putchar(int c)
putchar(c) is equivalent to putc(c,stdout).
int puts(const char *s)
puts writes the string s and a newline to stdout. It returns EOF if an error occurs,
non-negative otherwise.
int ungetc(int c, FILE *stream)
ungetc pushes c (converted to an unsigned char) back onto stream, where it will be
returned on the next read. Only one character of pushback per stream is guaranteed.
EOF may not be pushed back. ungetc returns the character pushed back, or EOF for
error.
int fgetc(FILE *stream)
fgetc returns the next character of stream as an unsigned char (converted to an
int), or EOF if end of file or error occurs.
char *fgets(char *s, int n, FILE *stream)
fgets reads at most the next n-1 characters into the array s, stopping if a newline is
encountered; the newline is included in the array, which is terminated by '\0'. fgets
returns s, or NULL if end of file or error occurs.
int fputc(int c, FILE *stream)
fputc writes the character c (converted to an unsigend char) on stream. It returns
the character written, or EOF for error.
int fputs(const char *s, FILE *stream)
fputs writes the string s (which need not contain \n) on stream; it returns nonnegative,
or EOF for an error.
int getc(FILE *stream)
getc is equivalent to fgetc except that if it is a macro, it may evaluate stream more
than once.
int getchar(void)
getchar is equivalent to getc(stdin).
char *gets(char *s)
gets reads the next input line into the array s; it replaces the terminating newline with
'\0'. It returns s, or NULL if end of file or error occurs.
int putc(int c, FILE *stream)
putc is equivalent to fputc except that if it is a macro, it may evaluate stream more
than once.
int putchar(int c)
putchar(c) is equivalent to putc(c,stdout).
int puts(const char *s)
puts writes the string s and a newline to stdout. It returns EOF if an error occurs,
non-negative otherwise.
int ungetc(int c, FILE *stream)
ungetc pushes c (converted to an unsigned char) back onto stream, where it will be
returned on the next read. Only one character of pushback per stream is guaranteed.
EOF may not be pushed back. ungetc returns the character pushed back, or EOF for
error.
相关文章推荐
- C Standard Library: Direct Input and Output Functions
- C Standard Library: 1 Input and Output: <stdio.h>
- Standard input, output, and error streams
- Using the High-Level Input and Output Functions
- Chapter 4 Character Strings and Formatted Input/Output
- Redirecting standard input and output
- C Standard Library: 10 Date and Time Functions: <time.h>
- Swift Standard Library: Documented and undocumented built-in functions in the Swift standard library
- Swift Standard Library: Documented and undocumented built-in functions in the Swift standard library – the complete list with all 74 functions
- Swift Standard Library: Documented and undocumented built-in functions in the Swift standard libr...
- Swift Standard Library: Documented and undocumented built-in functions in the Swift standard libr...
- [quote] standard Input and Output Redirection
- Standard Input and Output Redirection
- C++中使用array报错 requires compiler and library surpport for the ISO c++ 2011 standard
- Write a program to copy its input to its output, replacing each tab by \t, each backspace by \b, and each backslash by \\. This makes tabs and backspa
- 汇编语言的简单入门--Loop and output,input
- 【常规解题报告】Chapter 0 Input and Output
- MySQL5.7 InnoDB Standard Monitor and Lock Monitor Output
- File input and output 01
- Android Build with Gradle and ProGuard : “The output jar must be specified after an input jar, or it