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, a '\0' is appended.

Return

p

See also

memcpy() and memmove() and

strcpy()