Standard C Functions


strncpy


Syntax

#include <string.h>
char *strncpy(char *str1, const char *str2, size_t n);

Arguments

str1      pointer to the character string buffer that holds the copy destination 
str2      pointer to the character string buffer that supplies the source to be copied 
n         number of characters to be copied

Return Value

The pointer to str1 

Description

It copies n number of characters (excluding the NULL terminating character and any characters that follow it) from the location specified by str2 to the location specified by str1.