 |
Xyris
0.5
|
Go to the documentation of this file.
17 while (s[i] !=
'\0') {
23 char*
strcat(
char* dest,
const char* src)
25 const size_t len_dest =
strlen(dest);
26 const size_t len_src =
strlen(src);
27 memcpy(dest + len_dest, src, len_src + 1);
31 void strcpy(
char* dest,
const char* src)
41 void strncpy(
char* dest,
const char* src,
size_t len)
43 while (*src && len--) {
51 int strcmp(
const char *s1,
const char *s2)
62 return (
int)*s1 - (int)*s2;
65 const char*
strstr(
const char* haystack,
const char* needle)
69 if ((*haystack == *needle) && (
strcmp(haystack, needle) == 0)) {
82 for (
int i = 0; i < j; i++, j--) {
89 void itoa(
int n,
char str[])
96 str[i++] = (char)(n % 10 + (
int)
'0');
97 }
while ((n /= 10) > 0);
108 unsigned char* buf = (
unsigned char*)bufptr;
109 for (
size_t i = 0; i <
size; i++)
110 buf[i] = (
unsigned char)value;
114 int memcmp(
const void* ptr1,
const void* ptr2,
size_t num)
116 const unsigned char* a = (
const unsigned char*)ptr1;
117 const unsigned char* b = (
const unsigned char*)ptr2;
118 for (
size_t i = 0; i < num; i++) {
121 else if (a[i] > b[i])
129 unsigned char* dst = (
unsigned char*)destptr;
130 const unsigned char* src = (
const unsigned char*)srcptr;
132 for (
size_t i = 0; i <
size; i++)
135 for (
size_t i =
size; i != 0; i--)
136 dst[i - 1] = src[i - 1];
143 unsigned char* dst = (
unsigned char*)dstptr;
144 const unsigned char* src = (
const unsigned char*)srcptr;
145 for (
size_t i = 0; i <
size; i++)
char * strcat(char *dest, const char *src)
Concatanates source onto destination.
const char * strstr(const char *haystack, const char *needle)
Locates a substring (needle) within a containing string (haystack)
int memcmp(const void *ptr1, const void *ptr2, size_t num)
Compares a given number of bytes in memory at pointer A to pointer B.
int strlen(const char *s)
Returns the length of a string.
Standard string and memory utility library.
int strcmp(const char *s1, const char *s2)
Compares two strings.
void reverse(char *s)
Reverses the inputted string.
void strcpy(char *dest, const char *src)
Copys a string from the source to the destination.
void * memcpy(void *dstptr, const void *srcptr, size_t size)
void itoa(int n, char str[])
Converts an integer into its ASCII representation. (This does not have a standard,...
void * memmove(void *destptr, const void *srcptr, size_t size)
Moves a given number of bytes from the source to the destination.
void * memset(void *bufptr, int value, size_t size)
Sets the number of bytes in memory at ptr to the value.
void strncpy(char *dest, const char *src, size_t len)
Copys a string from the source to the destination.