stdio.h in C
stdio.h in C
The header file named stdio.h in Standard C Library defines three variable types, a number of macros and various functions to implement input and output.
The variables are defined in stdio.h
The following lists some types of variables defined in stdio.h in Library C:
Description variable size_tThis is an unsigned integer type and the result of the sizeof keyword
FILEThis is a suitable type of object to store information for a File Stream
fpos_tThis is a type of object suitable for storing any location in a File
The macros are defined in stdio.h
The table below lists some macros defined in stdio.h in Library C:
Macro Description NULLThis macro is the value of a null pointer constant
_IOFBF, _IOLBF and _IONBFThese are macros that develop integer constant expressions with separate and appropriate values to use as the third parameter for setvbuf function
BUFSIZThis macro is an integer, which represents the size of the Buffer used by the setbuf function
EOFThis macro is a vowel number, only that has reached End-Of-File
FOPEN_MAXThis macro is an integer, representing the maximum number of files that the system can guarantee to be opened simultaneously
FILENAME_MAXThis macro is an integer, representing the longest length of an appropriate character array to store the filename as long as possible. If the implementer is unlimited, then this value should be the recommended maximum value
L_tmpnamThis macro is an integer, representing the longest length of an appropriate character array to store the longest temporary filename possible, created by the tmpnam function.
SEEK_CUR, SEEK_END, and SEEK_SETThis macro is used in the fseek function to identify different locations in a File
TMP_MAXThis macro is the maximum number of unique filenames that tmpnam can create
stderr, stdin, and stdoutThese macros are pointers to FILE types corresponding to Standard Error, Standard Input and Standard Output Stream
Functions defined in stdio.h
Here are some functions defined in stdio.h in Library C:
STD & Description1Int fclose function (FILE * stream)
Close the Stream. All Buffers are Flush (wipe or transfer to the periphery)
2Void clearerr function (FILE * stream)
Delete end-of-file and error indicator for the given Stream
3Int feof function (FILE * stream)
Check the end-of-file indicator for the given Stream
4Int ferror function (FILE * stream)
Check the error indicator for the given Stream
5Int fflush function (FILE * stream)
Flush the output buffer of a Stream
6Int fgetpos function (FILE * stream, fpos_t * pos)
Take the current location of the Stream file and burn it to pos
7Function FILE * fopen (const char * filename, const char * mode)
Open the file name pointed to the filename parameter by using the given mode mode
8Function size_t fread (void * ptr, size_t size, size_t nmemb, FILE * stream)
Read data from Stream given in array pointed by ptr
9Function FILE * freopen (const char * filename, const char * mode, FILE * stream)
Mount a new filename with the given Stream and at the same time close the old FILE in the Stream
tenInt fseek (FILE * stream, long int offset, int whence)
Set Stream's file position to the given offset. The offset parameter specifies the number of bytes to search from where the given location is
11Int fsetpos function (FILE * stream, const fpos_t * pos)
Set the file location of the stream to the given location. The pos parameter is a location provided by the fgetpos function
twelfthLong int ftell function (FILE * stream)
Returns the current file location of the given Stream
13Function size_t fwrite (const void * ptr, size_t size, size_t nmemb, FILE * stream)
Write data from the array pointed by ptr to the given Stream
14Int remove function (const char * filename)
Delete the filename given so that it is no longer accessible
15Int rename function (const char * old_filename, const char * new_filename)
Make the filename referenced, changed from old_filename to new_filename
16Void rewind function (FILE * stream)
Set the file location to the beginning of the file in the given Stream
17Function void setbuf (* stream, char * buffer FILE)
Defining how a Stream should be buffered (buffer)
18Int setvbuf function (FILE * stream, char * buffer, int mode, size_t size)
Another function to determine how a Stream should be buffered (buffer)
19Function FILE * tmpfile (void)
Create temporary files in wb + mode
20Char * tmpnam function (char * str)
Create and return a valid temporary filename (does not exist before creating)
21Int fprintf function (FILE * stream, const char * format, .)
Send formatted output to a Stream
22Function int printf (const char * format, .)
Send formatted output to a stdout
23Int sprintf function (char * str, const char * format, .)
Send formatted output to a string string
24Int vfprintf (FILE * stream, const char * format, va_list arg)
Send formatted output to a stream using a parameter list
25Int vprintf function (const char * format, va_list arg)
Send formatted output to a stdout using a parameter list
26Int vsprintf function (char * str, const char * format, va_list arg)
Send formatted output to a string string by using a parameter list
27Int fscanf function (FILE * stream, const char * format, .)
Read input that has been formatted from a Stream
28Int scanf function (const char * format, .)
Read input has been formatted from stdin
29Function int sscanf (const char * str, const char * format, .)
Read the formatted input from a string string
30Int fgetc function (FILE * stream)
Take the next character (an unsigned char) from the given Stream and increase the position indicator for that Stream
thirty firstChar * fgets (char * str, int n, FILE * stream)
Read a line from the given Stream and store it in the string pointed by str. It stops when any of the following conditions are encountered: (n-1) the character has been read, the newline character (new line) is read or caught end-of-file
32Int fputc (int char, FILE * stream)
Writing a character (an unsigned char) was determined by the char parameter to the given Stream and increased the position indicator for the Stream
33Function int fputs (const char * str, FILE * stream)
Write a string to the specified Stream (do not write null characters)
34Int getc function (FILE * stream)
Take the next character (an unsigned char) from the given Stream and increase the position indicator for that Stream
35Int getchar (void) function
Get a character (an unsigned char) from stdin
36Char * gets function (char * str)
Read a line from stdin and store it inside the string pointed by str. It stops when the end-of-file or newline character is encountered (new line) is read
37Int putc (int char, FILE * stream)
Write a character (an unsigned char) defined by the char parameter to the given Stream and increase the position indicator for that Stream
38Int putchar (int char) function
Writing a character (an unsigned char) has been defined by the char parameter to stdout
39Function int puts (const char * str)
Write a str string to stdout (do not write null characters). A newline character (new line) is appended to the output
40Int ungetc function (int char, FILE * stream)
Push the char character (an unsigned char) on the Stream given to the next character to be read
41Function void perror (const char * str)
Print a message describing the error to stderr. First, the printed string str is followed by a colon and then a space
According to Tutorialspoint
Last lesson: stddef.h in C
Next lesson: The function fclose () in C
You should read it
May be interested
- Check out the 'buffalo' Pokémon in Pokémon Goeach type of pokemon has hp, cp, ability to attack and endure differently. based on these indicators, players can determine as well as choosing the most powerful pokemon for their offensive tactics.
- Sitting home can also locate Pokemon around, do you believe it?the tightening of the niantic developers' rules to prevent players from abusing the support tools also brings annoyance, such as those who have no conditions to move much, go away, it is hard to know. get the location of the pokemon around the area they live in
- 5 undeniable benefits when playing Pokemon Goget to know many new people, breathe fresh air, relieve stress, increase concentration thanks to going out for a walk .... are compelling reasons to force you to try pokemon go now .
- Want to earn the fastest Pokécoins in Pokémon Go? So don't miss this article!pokécoins in pokémon go play the role of buying items in the store. the more coins you earn, the more likely you are to buy more items. to earn pokécoins, players will have to complete certain tasks or buy real money.
- Pokémon systems when fighting in Pokémon Goeach pokémon system in pokémon go has different strengths, along with a specific weakness. this type of pokémon will have the power to attack the other pokémon, but can defeat the other pokémon. if you know the characteristics of each type, it will be easier to choose which pokémon to battle.
- The terms you need to know when playing Pokémon Gopokémon go is the most prominent name in recent days. this game of capturing and training virtual animals has created a relatively new way of playing, as players have to constantly move to catch pokémon. during the process of joining pokémon go, you will encounter and use a lot of important terms. so what do they mean?
- How to play Pokemon GO on Windows computersrecently, pokemon go has become a popular game, attracting thousands of gamers around the world. in previous posts network administrator has guided you on how to play pokemon go on android devices and ios devices. in the article below, network administrator will guide you how to play pokemon go on windows computers using bluestacks emulator software.
- How to become a good Pokémon Go hunter?with a new way of playing, pokémon go has created a new phenomenon in the game village around the world. players will have to go around and find pokémon for themselves. so how to quickly catch pokémon and in large numbers?
- Things to know to upgrade Pokémon in Pokémon Gothe whirlwind pokémon go has spread its power right on the first day of its release. everyone rushed to the street to find a pokémon for themselves. therefore, in order to become a pokémon hunter, you need to master the basics of participating in pokémon go battlefield.
- List of medals received in Pokemon Goin addition to getting items when leveling up, gamers who join pokemon go also have the opportunity to receive their proud achievements.