C++ Programming/Code/Standard C Library/Functions/strncpy

< C++ Programming < Code < Standard C Library < Functions

strncpy

Syntax
#include <cstring>
char *strncpy( char *to, const char *from, size_t count );

The strncpy() function copies at most count characters of from to the string to. Only if from has less than count characters, is the remainder padded with '\0' characters. The return value is the resulting string.

Related topics
memcpy - strchr - strcpy - strncat - strncmp
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.