strncat() функция

Forums:

#include string.h>
char *strncat(char * restrict s1,const char * restrict s2, size_t n);

Описание
Функци strncat() прибавляет не более n символов -( причём null символ и символы после него не добавляются - видимо те , что из строки s2) из строки s2 в конец строки s1, при этом первый символ прибавляемой строки перекрывает завершающий null-символ строки , к которой происходит прибавление.
К полученной сумме строк всегда добавляется завершающий null-символ.

Возвращаемое значение:
Функция возвращает указатель на s1

Synopsis
#include string.h>
char *strncat(char * restrict s1,
const char * restrict s2,
size_t n);
Description
The strncat function appends not more than n characters (a null character and
characters that follow it are not appended) from the array pointed to by s2 to the end of
the string pointed to by s1. The initial character of s2 overwrites the null character at the
end of s1. A terminating null character is always appended to the result.
264)
If copying
263) Thus, if there is no null character in the ?rst n characters of the array pointed to by s2, the result will
not be null-terminated.
264) Thus, the maximum number of characters that can end up in the array pointed to by s1 is
strlen(s1)+n+1.
takes place between objects that overlap, the behavior is unde?ned.
Returns
The strncat function returns the value of s1.
Forward references: the strlen function (7.21.6.3).