strncpy()

Syntax
  #include <string.h>
  
  char *strncpy(char *p, const char *q, size_t n);

  
Description

strncpy() copies at most the first n characters of string q to string p, overwriting p's previous contents. If q contains less than n characters, strncpy() appends a \0.

Return

p

See also

memcpy()

strcpy()