std::strncpy

From Cppreference

Jump to: navigation, search
Defined in header <cstring>

char *strncpy( char *dest, const char *src, size_t count );

Copies the character string pointed to by src to character string, pointed to by dest. At most count characters are copied. If the limit is hit, the resulting character string is not null-terminated.

Contents

[edit] Parameters

dest - pointer to the character string to copy to
src - pointer to the character string to copy from
count - maximum number of characters to copy

[edit] Return value

dest

[edit] Example

[edit] See also

strcpy
copies one string to another
(function)
memcpy
copies one buffer to another
(function)