STRNCPY – copy characters from string.
strncpy() copies n bytes and it adds null termination at the end of the target string.
Syntax: ptr = strncpy( s1, s2, N );
char *s1 – It points to an area of memory that is to receive the copied characters. This must be able to hold at least N characters.
const char *s2 : Itpoints to the string from which characters will be copied.
size_t N : The number of characters to copy.
char *ptr : Points to the copied string (i.e. “s1″)
.
char *(strncpy)(char * s1, const char *, size_t n)
{
char *dst = s1;
const char *src = s2;
while (n > 0) {
n–;
if ((*dst++ = *src++) == ‘
