Crossware

Table of Contents        Previous topic       Next topic       

C LIBRARY FUNCTIONS->Detailed Descriptions->strncpy()

Summary

#include <string.h>

    
char *strncpy(char* string1, const char* string2, size_r n);Copy one string to another

Parameters

    
string1Destination string
string2Source string
nNumber of characters to be copied

Description

This function copies exactly n characters from string2 into string1.  If n is longer than the length of string2, then string1 is padded with null characters ('\0') up to length n.


Return Value

The pointer to string1 is returned.