programming.nbk: Home | Index | Next Page: strpbrk(const char* string1, const char* string2) | Previous Page: strncat(char *s1, const char *s2, size_t n)


 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.

Syntax

Parameters

Return Values

The strncpy() function returns the value of s1.


programming.nbk: Home | Index | Next Page: strpbrk(const char* string1, const char* string2) | Previous Page: strncat(char *s1, const char *s2, size_t n)


Notebook exported on Monday, 7 July 2008, 18:56:06 PM Eastern Daylight Time