Standard I/0 functions.
More...
|
void | putchar (int character) |
| Writes the given character to the standard output (stdout). More...
|
|
void | puts (const char *str) |
| Writes the string pointed by str to the standard output (stdout) and appends a newline character. More...
|
|
int | getchar (void) |
| Returns the next character from the standard input (stdin). More...
|
|
char * | gets (char *str) |
| Reads characters from the standard input (stdin). More...
|
|
int | atoi (const char *str) |
| Convert the given string to an integer. More...
|
|
long | strtol (const char *str, char **endptr, int base) |
| Converts the initial part of str to a long int value according to the given base, which. More...
|
|
int | fgetc (int fd) |
| Same as getchar but reads from the given file descriptor. More...
|
|
char * | fgets (char *buf, int n, int fd) |
| Same as gets but reads from the given file descriptor. More...
|
|
void | perror (const char *s) |
| Prints a system error message. More...
|
|
Standard I/0 functions.
- Copyright
- (c) 2014-2024 This file is distributed under the MIT License. See LICENSE.md for details.
◆ atoi()
int atoi |
( |
const char * |
str | ) |
|
Convert the given string to an integer.
- Parameters
-
str | The string to convert. |
- Returns
- The integer contained inside the string.
◆ fgetc()
Same as getchar but reads from the given file descriptor.
- Parameters
-
fd | The file descriptor from which it reads. |
- Returns
- The read character.
◆ fgets()
char* fgets |
( |
char * |
buf, |
|
|
int |
n, |
|
|
int |
fd |
|
) |
| |
Same as gets but reads from the given file descriptor.
- Parameters
-
buf | The buffer where the string should be placed. |
n | The amount of characters to read. |
fd | The file descriptor from which it reads. |
- Returns
- The read string.
◆ getchar()
Returns the next character from the standard input (stdin).
- Returns
- The character received from stdin.
◆ gets()
Reads characters from the standard input (stdin).
- Parameters
-
str | Where the characters are stored. |
- Returns
- The string received from standard input.
◆ perror()
void perror |
( |
const char * |
s | ) |
|
Prints a system error message.
- Parameters
-
s | the message we prepend to the actual error message. |
◆ putchar()
void putchar |
( |
int |
character | ) |
|
Writes the given character to the standard output (stdout).
- Parameters
-
character | The character to send to stdout. |
◆ puts()
void puts |
( |
const char * |
str | ) |
|
Writes the string pointed by str to the standard output (stdout) and appends a newline character.
- Parameters
-
str | The string to send to stdout. |
◆ strtol()
long strtol |
( |
const char * |
str, |
|
|
char ** |
endptr, |
|
|
int |
base |
|
) |
| |
Converts the initial part of str
to a long int value according to the given base, which.
- Parameters
-
str | This is the string containing the integral number. |
endptr | Set to the character after the numerical value. |
base | The base must be between 2 and 36 inclusive, or special 0. |
- Returns
- Integral number as a long int value, else zero value is returned.