In the following table, variables s is of type char *; cs and ct are of type const char *; and c is an int converted to char.
char *strcpy(s,ct) | copy string ct to string s, including '\0'; return s. |
char *strcat(s,ct) | concatenate string ct to end of string s; return s. |
int strcmp(cs,ct) | compare string cs to string ct, return <0 if cs<ct, 0 if cs==ct, or >0 if cs>ct. |
char *strchr(cs,c) | return pointer to first occurrence of c in cs or NULL if not present. |
char *strstr(cs,ct) | return pointer to first occurrence of string ct in cs, or NULL if not present. |
size_t strlen(cs) | return length of cs. |
In the following table, s is of type void *; ct is of type const void *; n is of type size_t; and c is an int converted to an unsigned char.
void *memcpy(s,ct,n) | copy n characters from ct to s, and return s. |
void *memset(s,c,n) | place character c into first n characters of s, return s. |
In the following table, x and y are of type double, and all functions return double.
exp(x) | exponential function ex |
log(x) | natural logarithm ln(x), x>0. |
log10(x) | base 10 logarithm log10(x), x>0. |
pow(x,y) | xy. A domain error occurs if x=0 and y<=0, or if x<0 and y is not an integer. |
sqrt(x) | square root of x, x>=0. |
fabs(x) | absolute value |x| |