#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. If from has less than count characters, the remainder is padded with '\0' characters. The return value is the resulting string.

Another set of related (but non-standard) functions are strlcpy and strlcat.