The strcpy() function copies the string pointed to by src, in‐
cluding the terminating null byte ('\0'), to the buffer
pointed to by dest. The strings may not overlap, and the des‐
tination string dest must be large enough to receive the copy.
Beware of buffer overruns! (See BUGS.)
The strncpy() function is similar, except that at most n bytes
of src are copied. Warning: If there is no null byte among
the first n bytes of src, the string placed in dest will not
be null-terminated.
The strcat() function 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. The strings may not
overlap, and the dest string must have enough space for the result. If dest is not large
enough, program behavior is unpredictable; buffer overruns are a favorite avenue for attacking
secure programs.
The strcmp() function compares the two strings s1 and s2. The locale is not taken into account
(for a locale-aware comparison, see strcoll(3)). It returns an integer less than, equal to, or
greater than zero if s1 is found, respectively, to be less than, to match, or be greater than
s2.
The strncmp() function is similar, except it compares only the first (at most) n bytes of s1 and
s2.