Utility Functions and C Language Reference > C Language Reference > Alphabetical List of Functions > strncpy


Example: strncpy String Manipulation Functions

Copies the first n characters of one string to another.

char *strncpy( char *dest, const char *source, size_t n ); 

dest The destination string to which n characters are copied.
source The source string from which n characters are copied.
n The number of characters copied.

Return Values

Returns the destination string.