📄 stdio.h
字号:
*/
#ifdef __EDG__
#pragma __printf_args
#endif
extern int _fprintf(FILE * /*stream*/, const char * /*format*/, ...);
/*
* is equivalent to fprintf, but does not support floating-point formats.
* You can use instead of fprintf to improve code size.
* Returns: as fprintf.
*/
#ifdef __EDG__
#pragma __printf_args
#endif
extern int printf(const char * /*format*/, ...);
/*
* is equivalent to fprintf with the argument stdout interposed before the
* arguments to printf.
* Returns: the number of characters transmitted, or a negative value if an
* output error occurred.
*/
#ifdef __EDG__
#pragma __printf_args
#endif
extern int _printf(const char * /*format*/, ...);
/*
* is equivalent to printf, but does not support floating-point formats.
* You can use instead of printf to improve code size.
* Returns: as printf.
*/
#ifdef __EDG__
#pragma __printf_args
#endif
extern int sprintf(char * /*s*/, const char * /*format*/, ...);
/*
* is equivalent to fprintf, except that the argument s specifies an array
* into which the generated output is to be written, rather than to a
* stream. A null character is written at the end of the characters written;
* it is not counted as part of the returned sum.
* Returns: the number of characters written to the array, not counting the
* terminating null character.
*/
#ifdef __EDG__
#pragma __printf_args
#endif
extern int _sprintf(char * /*s*/, const char * /*format*/, ...);
/*
* is equivalent to sprintf, but does not support floating-point formats.
* You can use instead of sprintf to improve code size.
* Returns: as sprintf.
*/
#ifndef __STRICT_ANSI__
#ifdef __EDG__
#pragma __printf_args
#endif
extern int snprintf(char * /*s*/, size_t /*n*/, const char * /*format*/, ...);
/*
* is equivalent to fprintf, except that the argument s specifies an array
* into which the generated output is to be written, rather than to a
* stream. The argument n specifies the size of the output array, so as to
* avoid overflowing the buffer.
* A null character is written at the end of the characters written, even
* if the formatting was not completed; it is not counted as part of the
* returned sum. At most n characters of the output buffer are used,
* _including_ the null character.
* Returns: the number of characters that would have been written to the
* array, not counting the terminating null character, if the
* array had been big enough. So if the return is >=0 and <n, then
* the entire string was successfully formatted; if the return is
* >=n, the string was truncated (but there is still a null char
* at the end of what was written); if the return is <0, there was
* an error.
*/
#endif
#ifdef __EDG__
#pragma __printf_args
#endif
extern int _snprintf(char * /*s*/, size_t /*n*/, const char * /*format*/, ...);
/*
* is equivalent to snprintf, but does not support floating-point formats.
* You can use instead of snprintf to improve code size.
* Returns: as snprintf.
*/
#ifdef __EDG__
#pragma __scanf_args
#else
#pragma no_check_printf_formats /* back to default */
#pragma check_scanf_formats /* hint to the compiler to check f/s/scanf format */
#endif
extern int fscanf(FILE * /*stream*/, const char * /*format*/, ...);
/*
* reads input from the stream pointed to by stream, under control of the
* string pointed to by format that specifies the admissible input sequences
* and how thay are to be converted for assignment, using subsequent
* arguments as pointers to the objects to receive the converted input. If
* there are insufficient arguments for the format, the behaviour is
* undefined. If the format is exhausted while arguments remain, the excess
* arguments are evaluated but otherwise ignored.
* The format is composed of zero or more directives: one or more
* white-space characters; an ordinary character (not %); or a conversion
* specification. Each conversion specification is introduced by the
* character %. For a description of the available conversion specifiers
* refer to section 4.9.6.2 in the ANSI draft mentioned at the start of this
* file, or to any modern textbook on C.
* If end-of-file is encountered during input, conversion is terminated. If
* end-of-file occurs before any characters matching the current directive
* have been read (other than leading white space, where permitted),
* execution of the current directive terminates with an input failure;
* otherwise, unless execution of the current directive is terminated with a
* matching failure, execution of the following directive (if any) is
* terminated with an input failure.
* If conversions terminates on a conflicting input character, the offending
* input character is left unread in the input strem. Trailing white space
* (including new-line characters) is left unread unless matched by a
* directive. The success of literal matches and suppressed asignments is
* not directly determinable other than via the %n directive.
* Returns: the value of the macro EOF if an input failure occurs before any
* conversion. Otherwise, the fscanf function returns the number of
* input items assigned, which can be fewer than provided for, or
* even zero, in the event of an early conflict between an input
* character and the format.
*/
extern int _fscanf(FILE * /*stream*/, const char * /*format*/, ...);
/*
* is equivalent to fscanf, but does not support floating-point formats.
* You can use instead of fscanf to improve code size.
* Returns: as fscanf.
*/
#ifdef __EDG__
#pragma __scanf_args
#endif
extern int scanf(const char * /*format*/, ...);
/*
* is equivalent to fscanf with the argument stdin interposed before the
* arguments to scanf.
* Returns: the value of the macro EOF if an input failure occurs before any
* conversion. Otherwise, the scanf function returns the number of
* input items assigned, which can be fewer than provided for, or
* even zero, in the event of an early matching failure.
*/
#ifdef __EDG__
#pragma __scanf_args
#endif
extern int _scanf(const char * /*format*/, ...);
/*
* is equivalent to scanf, but does not support floating-point formats.
* You can use instead of scanf to improve code size.
* Returns: as scanf.
*/
#ifdef __EDG__
#pragma __scanf_args
#endif
extern int sscanf(const char * /*s*/, const char * /*format*/, ...);
/*
* is equivalent to fscanf except that the argument s specifies a string
* from which the input is to be obtained, rather than from a stream.
* Reaching the end of the string is equivalent to encountering end-of-file
* for the fscanf function.
* Returns: the value of the macro EOF if an input failure occurs before any
* conversion. Otherwise, the scanf function returns the number of
* input items assigned, which can be fewer than provided for, or
* even zero, in the event of an early matching failure.
*/
#ifdef __EDG__
#pragma __scanf_args
#endif
extern int _sscanf(const char * /*s*/, const char * /*format*/, ...);
/*
* is equivalent to sscanf, but does not support floating-point formats.
* You can use instead of sscanf to improve code size.
* Returns: as sscanf.
*/
#ifndef __EDG__
#pragma no_check_scanf_formats /* back to default */
#pragma check_vprintf_formats /* hint to the compiler to examine vf/s/snprintf format */
#endif
extern int vprintf(const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to printf, with the variable argument list replaced by arg,
* which has been initialised by the va_start macro (and possibly subsequent
* va_arg calls). The vprintf function does not invoke the va_end function.
* Returns: the number of characters transmitted, or a negative value if an
* output error occurred.
*/
extern int _vprintf(const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to vprintf, but does not support floating-point formats.
* You can use instead of vprintf to improve code size.
* Returns: as vprintf.
*/
extern int vfprintf(FILE * /*stream*/,
const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to fprintf, with the variable argument list replaced by
* arg, which has been initialised by the va_start macro (and possibly
* subsequent va_arg calls). The vfprintf function does not invoke the
* va_end function.
* Returns: the number of characters transmitted, or a negative value if an
* output error occurred.
*/
extern int vsprintf(char * /*s*/, const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to sprintf, with the variable argument list replaced by
* arg, which has been initialised by the va_start macro (and possibly
* subsequent va_arg calls). The vsprintf function does not invoke the
* va_end function.
* Returns: the number of characters written in the array, not counting the
* terminating null character.
*/
#ifndef __STRICT_ANSI__
extern int vsnprintf(char * /*s*/, size_t /*n*/,
const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to snprintf, with the variable argument list replaced by
* arg, which has been initialised by the va_start macro (and possibly
* subsequent va_arg calls). The vsprintf function does not invoke the
* va_end function.
* Returns: the number of characters that would have been written in the
* array, not counting the terminating null character. As
* snprintf.
*/
#endif
#ifndef __EDG__
#pragma no_check_vprintf_formats /* back to default */
#endif
extern int _vsprintf(char * /*s*/, const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to vsprintf, but does not support floating-point formats.
* You can use instead of vsprintf to improve code size.
* Returns: as vsprintf.
*/
extern int _vfprintf(FILE * /*stream*/,
const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to vfprintf, but does not support floating-point formats.
* You can use instead of vfprintf to improve code size.
* Returns: as vfprintf.
*/
extern int _vsnprintf(char * /*s*/, size_t /*n*/,
const char * /*format*/, __va_list /*arg*/);
/*
* is equivalent to vsnprintf, but does not support floating-point formats.
* You can use instead of vsnprintf to improve code size.
* Returns: as vsnprintf.
*/
extern int fgetc(FILE * /*stream*/);
/*
* obtains the next character (if present) as an unsigned char converted to
* an int, from the input stream pointed to by stream, and advances the
* associated file position indicator (if defined).
* Returns: the next character from the input stream pointed to by stream.
* If the stream is at end-of-file, the end-of-file indicator is
* set and fgetc returns EOF. If a read error occurs, the error
* indicator is set and fgetc returns EOF.
*/
extern char *fgets(char * /*s*/, int /*n*/, FILE * /*stream*/);
/*
* reads at most one less than the number of characters specified by n from
* the stream pointed to by stream into the array pointed to by s. No
* additional characters are read after a new-line character (which is
* retained) or after end-of-file. A null character is written immediately
* after the last character read into the array.
* Returns: s if successful. If end-of-file is encountered and no characters
* have been read into the array, the contents of the array remain
* unchanged and a null pointer is returned. If a read error occurs
* during the operation, the array contents are indeterminate and a
* null pointer is returned.
*/
extern int fputc(int /*c*/, FILE * /*stream*/);
/*
* writes the character specified by c (converted to an unsigned char) to
* the output stream pointed to by stream, at the position indicated by the
* asociated file position indicator (if defined), and advances the
* indicator appropriately. If the file position indicator is not defined,
* the character is appended to the output stream.
* Returns: the character written. If a write error occurs, the error
* indicator is set and fputc returns EOF.
*/
extern int fputs(const char * /*s*/, FILE * /*stream*/);
/*
* writes the string pointed to by s to the stream pointed to by stream.
* The terminating null character is not written.
* Returns: EOF if a write error occurs; otherwise it returns a nonnegative
* value.
*/
extern int getc(FILE * /*stream*/);
/*
* is equivalent to fgetc except that it may be implemented as an unsafe
* macro (stream may be evaluated more than once, so the argument should
* never be an expression with side-effects).
* Returns: the next character from the input stream pointed to by stream.
* If the stream is at end-of-file, the end-of-file indicator is
* set and getc returns EOF. If a read error occurs, the error
* indicator is set and getc returns EOF.
*/
#ifdef __cplusplus
inline int getchar() { return getc(stdin); }
#else
#define getchar() getc(stdin)
extern int (getchar)(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -