Small subset of string.h.
More...
|
void * | memset (void *s, int c, size_t n) |
|
void * | memcpy (void *dest, const void *src, size_t n) |
|
size_t | strlen (const char *s) |
|
int | strcmp (const char *s1, const char *s2) |
|
char * | strcpy (char *dest, const char *src) |
|
char * | strcat (char *dest, const char *src) |
|
void | strrev (char *s) |
|
Small subset of string.h.
◆ memcpy()
void* memcpy |
( |
void * |
dest, |
|
|
const void * |
src, |
|
|
size_t |
n |
|
) |
| |
Copies n bytes from memory area src to memory area dest. The memory areas must not overlap.
- Returns
- A pointer to dest.
◆ memset()
void* memset |
( |
void * |
s, |
|
|
int |
c, |
|
|
size_t |
n |
|
) |
| |
Fills the first n bytes of the memory area pointed to by s with the constant byte c.
- Returns
- A pointer to the memory area s.
◆ strcat()
char* strcat |
( |
char * |
dest, |
|
|
const char * |
src |
|
) |
| |
Appends the src string to the dest string, overwriting the terminating null byte ('\0') at the end of dest, and then adds a terminating null byte.
- Parameters
-
dest | A string pointer. |
src | A string pointer. |
- Returns
- A pointer to the resulting string dest.
◆ strcmp()
int strcmp |
( |
const char * |
s1, |
|
|
const char * |
s2 |
|
) |
| |
Compares the two strings s1 and s2.
- Parameters
-
s1 | A string pointer. |
s2 | A string pointer. |
- Returns
- An integer less than, equal to, or greater than 0 if s1 is found, respectively, to be less than, to match, or be greater than s2.
◆ strcpy()
char* strcpy |
( |
char * |
dest, |
|
|
const char * |
src |
|
) |
| |
Copies the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest.
- Parameters
-
dest | A string pointer. |
src | A string pointer. |
- Returns
- A pointer to the destination string dest.
◆ strlen()
size_t strlen |
( |
const char * |
s | ) |
|
Calculates the length of the string pointed to by s, excluding the terminating null byte ('\0').
- Parameters
-
- Returns
- The number of bytes in the string pointed to by s.
◆ strrev()
Reverses a given string in place.
- Parameters
-
- See also
- strlen()