strncpy()

copy part of string 

Function


SYNOPSIS

#include <string.h>

char *strncpy(char *s1, const char *s2, size_t n);


DESCRIPTION

The strncpy() function copies up to n characters, including the terminating null character, from the string pointed to by s2 into the buffer pointed to by s1. Once strncpy() has copied n characters to s1, it does not append a terminating null character.

The function strncpy() does not allocate any storage. The caller must insure that the buffer pointed to by s1 is long enough to hold the characters copied to it.


PARAMETERS

s1 

Points to a destination buffer.

s2 

Points to the source string to be copied into s1.

n 

Is the maximum number of characters to copy from s2 to s1.


RETURN VALUES

The strncpy() function returns the value of s1.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
memcpy(), strcat(), strcpy(), strdup()


PTC MKS Toolkit 10.2 Documentation Build 28.