MicrOS
strncpy.c File Reference
#include "../string.h"

Functions

char * strncpy (char *destination, const char *source, size_t num)
 Copy characters from string. More...
 

Function Documentation

◆ strncpy()

char* strncpy ( char *  destination,
const char *  source,
size_t  num 
)

Copy characters from string.

Copies the first num characters of source to destination. If the end of the source C string (which is signaled by a null-character) is found before num characters have been copied, destination is padded with zeros until a total of num characters have been written to it.

Parameters
destinationPointer to the destination array where the content is to be copied.
sourceC string to be copied.
numMaximum number of characters to be copied from source.
Returns
Destination is returned.