c语言stdioh里面的函数,c语言标准函数库的stdioh

1,c语言标准函数库的stdiohBUFSIZSize of buffer used bysetbuf.EOFValue used to indicate end-of-stream or to report an error.FILENAME_MAXMaximum length required for array of characters to hold a filename.FOPEN_MAXMaximum number of files which may be open simultaneously.L_tmpnamNumber of characters required for temporary filename generated bytmpnam.NULLNull pointer constant.SEEK_CURValue for origin argument to fseek specifying current file position.SEEK_ENDValue for origin argument to fseek specifying end of file.SEEK_SETValue for origin argument to fseek specifying beginning of file.TMP_MAXMinimum number of unique filenames generated by calls to tmpnam._IOFBFValue for mode argument to setvbuf specifying full buffering._IOLBFValue for mode argument to setvbuf specifying line buffering._IONBFValue for mode argument to setvbuf specifying no buffering.stdinFile pointer for standard input stream. Automatically opened when program execution begins.stdoutFile pointer for standard output stream. Automatically opened when program execution begins.stderrFile pointer for standard error stream. Automatically opened when program execution begins.FILEType of object holding information necessary to control a stream.fpos_tType for objects declared to store file position information.size_tType for objects declared to store result of sizeof operator.FILE* fopen(const char* filename, const char* mode);Opens file named filename and returns a stream, or NULL on failure. mode may be one of the following for text files:rtext readingwtext writingatext appendr+text update (reading and writing)w+text update, discarding previous content (if any)a+text append, reading, and writing at endor one of those strings with b included (after the first character), for binary files.FILE* freopen(const char* filename, const char* mode, FILE* stream);Closes file associated with stream, then opens file filename with specified mode and associates it with stream. Returns stream or NULL on error.int fflush(FILE* stream);Flushes stream stream and returns zero on success or EOF on error. Effect undefined for input stream. fflush(NULL) flushes all output streams.int fclose(FILE* stream);Closes stream stream (after flushing, if output stream). Returns EOF on error, zero otherwise.int remove(const char* filename);Removes specified file. Returns non-zero on failure.int rename(const char* oldname, const char* newname);Changes name of file oldname to newname. Returns non-zero on failure.FILE* tmpfile();Creates temporary file (mode wb+) which will be removed when closed or on normal program termination. Returns stream or NULL on failure.char*tmpnam(char s[L_tmpnam]);Assigns to s (if s non-null) and returns unique name for a temporary file. Unique name is returned for each of the first TMP_MAX invocations.int setvbuf(FILE* stream, char* buf, int mode,size_tsize);Controls buffering for stream stream. mode is _IOFBF for full buffering, _IOLBF for line buffering, _IONBF for no buffering. Non-null buf specifies buffer of size size to be used; otherwise, a buffer is allocated. Returns non-zero on error. Call must be before any other operation on stream.voidsetbuf(FILE* stream, char* buf);Controls buffering for stream stream. For null buf, turns off buffering, otherwise equivalent to (void)setvbuf(stream, buf, _IOFBF, BUFSIZ).int fprintf(FILE* stream, const char* format, ...);Converts (according to format format) and writes output to stream stream. Number of characters written, or negative value on error, is returned. Conversion specifications consist of:%(optional) flag:-left adjust+always signspacespace if no sign0zero pad#Alternate form: for conversion character o, first digit will be zero, for [xX], prefix 0x or 0X to non-zero value, for [eEfgG], always decimal point, for [gG] trailing zeros not removed.(optional) minimum width: if specified as *, value taken from next argument (which must be int).(optional) . (separating width from precision):(optional) precision: for conversion character s, maximum characters to be printed from the string, for [eEf], digits after decimal point, for [gG], significant digits, for an integer, minimum number of digits to be printed. If specified as *, value taken from next argument (which must be int).(optional) length modifier:hshort or unsigned shortllong or unsigned longLlong doubleconversion character:d,iint argument, printed in signed decimal notationoint argument, printed in unsigned octal notationx,Xint argument, printed in unsigned hexadecimal notationuint argument, printed in unsigned decimal notationcint argument, printed as single characterschar* argumentfdouble argument, printed with format [-]mmm.ddde,Edouble argument, printed with format [-]m.dddddd(e|E)(+|-)xxg,Gdouble argumentpvoid* argument, printed as pointernint* argument : the number of characters written to this point is written into argument%no argument; prints %int printf(const char* format, ...);printf(f, ...) is equivalent to fprintf(stdout, f, ...)int sprintf(char* s, const char* format, ...);Like fprintf, but output written into string s, which must be large enough to hold the output, rather than to a stream. Output is NUL-terminated. Returns length (excluding the terminating NUL).int vfprintf(FILE* stream, const char* format, va_list arg);Equivalent to fprintf with variable argument list replaced by arg, which must have been initialised by the va_start macro (and may have been used in calls to va_arg).int vprintf(const char* format, va_list arg);Equivalent to printf with variable argument list replaced by arg, which must have been initialised by the va_start macro (and may have been used in calls to va_arg).int vsprintf(char* s, const char* format, va_list arg);Equivalent to sprintf with variable argument list replaced by arg, which must have been initialised by the va_start macro (and may have been used in calls to va_arg).int fscanf(FILE* stream, const char* format, ...);Performs formatted input conversion, reading from stream stream according to format format. The function returns when format is fully processed. Returns number of items converted and assigned, or EOF if end-of-file or error occurs before any conversion. Each of the arguments following format must be a pointer. Format string may contain:blanks and tabs, which are ignoredordinary characters, which are expected to match next non-white-spaceof inputconversion specifications, consisting of:%(optional) assignment suppression character *(optional) maximum field width(optional) target width indicator:hargument is pointer to short rather than intlargument is pointer to long rather than int, or double rather than floatLargument is pointer to long double rather than floatconversion character:ddecimal integer; int* parameter requirediinteger; int* parameter required; decimal, octal or hexooctal integer; int* parameter requireduunsigned decimal integer; unsigned int* parameter requiredxhexadecimal integer; int* parameter requiredccharacters; char* parameter required;white-spaceis not skipped, and NUL-termination is not performedsstring of non-white-space; char* parameter required; string is NUL-terminatede,f,gfloating-point number; float* parameter requiredppointer value; void* parameter requirednchars read so far; int* parameter required[...]longest non-empty string from specified set; char* parameter required; string is NUL-terminated[^...]longest non-empty string not from specified set; char* parameter required; string is NUL-terminated%literal %; no assignmentint scanf(const char* format, ...);scanf(f, ...) is equivalent to fscanf(stdin, f, ...)int sscanf(char* s, const char* format, ...);Like fscanf, but input read from string s.int fgetc(FILE* stream);Returns next character from (input) stream stream, or EOF on end-of-file or error.char* fgets(char* s, int n, FILE* stream);Copies characters from (input) stream stream to s, stopping when n-1 characters copied, newline copied, end-of-file reached or error occurs. If no error, s is NUL-terminated. Returns NULL on end-of-file or error, s otherwise.int fputc(int c, FILE* stream);Writes c, to stream stream. Returns c, or EOF on error.char* fputs(const char* s, FILE* stream);Writes s, to (output) stream stream. Returns non-negative on success or EOF on error.int getc(FILE* stream);Equivalent to fgetc except that it may be a macro.int getchar(void);Equivalent to getc(stdin).char* gets(char* s);Copies characters from stdin into s until newline encountered, end-of-file reached, or error occurs. Does not copy newline. NUL-terminates s. Returns s, or NULL on end-of-file or error. Should not be used because of the potential for buffer overflow.int putc(int c, FILE* stream);Equivalent to fputc except that it may be a macro.int putchar(int c);putchar(c) is equivalent to putc(c, stdout).int puts(const char* s);Writes s (excluding terminating NUL) and a newline to stdout. Returns non-negative on success, EOF on error.intungetc(int c, FILE* stream);Pushes c (which must not be EOF), onto (input) stream stream such that it will be returned by the next read. Only one character of pushback is guaranteed (for each stream). Returns c, or EOF on error.size_t fread(void* ptr, size_t size, size_t nobj, FILE* stream);Reads (at most) nobj objects of size size from stream stream into ptr and returns number of objects read. (feof and ferror can be used to check status.)size_tfwrite(const void* ptr, size_t size, size_t nobj, FILE* stream);Writes to stream stream, nobj objects of size size from array ptr. Returns number of objects written.int fseek(FILE* stream, long offset, int origin);Sets file position for stream stream and clears end-of-file indicator. For a binary stream, file position is set to offset bytes from the position indicated by origin: beginning of file for SEEK_SET, current position for SEEK_CUR, or end of file for SEEK_END. Behaviour is similar for a text stream, but offset must be zero or, for SEEK_SET only, a value returned by ftell. Returns non-zero on error.long ftell(FILE* stream);Returns current file position for stream stream, or -1 on error.void rewind(FILE* stream);Equivalent to fseek(stream, 0L, SEEK_SET);clearerr(stream).intfgetpos(FILE* stream, fpos_t* ptr);Stores current file position for stream stream in *ptr. Returns non-zero on error.intfsetpos(FILE* stream, const fpos_t* ptr);Sets current position of stream stream to *ptr. Returns non-zero on error.voidclearerr(FILE* stream);Clears end-of-file and error indicators for stream stream.int feof(FILE* stream);Returns non-zero if end-of-file indicator is set for stream stream.int ferror(FILE* stream);Returns non-zero if error indicator is set for stream stream.void perror(const char* s);Prints s (if non-null) and strerror(errno) to standard error as would:fprintf(stderr, %s: %s\n, (s != NULL ? s : ), strerror(errno))你说的这些是头文件,还有很多的头文件,主要是对库函数的声明,但不是库函数本身 。比如,开平方根函数sqrt就在math.h这个头文件里声明了 。库函数在lib文件夹里,而头文件在include文件夹里 。【c语言stdioh里面的函数,c语言标准函数库的stdioh】
2,c中stdioh中包含了哪些函数的定义顾名思义 , 标准IO相关的函数 , f打头的函数,如fopen、fdopen等 。事实上 , 手工查看一下该文件就知道了 。
3,c语言的stdioh里面包含哪些函数能将所有的列举出来吗头文件中申明了可以调用的函数 。你可以打开stdio.h来看啊 。现在我装的是vc6.0其默认安装目录下c:\programfiles\microsoftvisualstudio\vc98\include有stdio.h文件 。/*functionprototypes*///函数申明#ifndef_stdio_defined_crtimpint__cdecl_filbuf(file*);_crtimpint__cdecl_flsbuf(int,file*);#ifdef_posix__crtimpfile*__cdecl_fsopen(constchar*,constchar*);#else_crtimpfile*__cdecl_fsopen(constchar*,constchar*,int);#endif_crtimpvoid__cdeclclearerr(file*);_crtimpint__cdeclfclose(file*);_crtimpint__cdecl_fcloseall(void);#ifdef_posix__crtimpfile*__cdeclfdopen(int,constchar*);#else_crtimpfile*__cdecl_fdopen(int,constchar*);#endif_crtimpint__cdeclfeof(file*);_crtimpint__cdeclferror(file*);_crtimpint__cdeclfflush(file*);_crtimpint__cdeclfgetc(file*);_crtimpint__cdecl_fgetchar(void);_crtimpint__cdeclfgetpos(file*,fpos_t*);_crtimpchar*__cdeclfgets(char*,int,file*);#ifdef_posix__crtimpint__cdeclfileno(file*);#else_crtimpint__cdecl_fileno(file*);#endif 。。。

    推荐阅读