Localization library | |||||||||||||||||||||||||
Regular expressions library(C++11) | |||||||||||||||||||||||||
Formatting library(C++20) | |||||||||||||||||||||||||
Null-terminated sequence utilities | |||||||||||||||||||||||||
Byte strings | |||||||||||||||||||||||||
Multibyte strings | |||||||||||||||||||||||||
Wide strings | |||||||||||||||||||||||||
Primitive numeric conversions | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
Text encoding identifications | |||||||||||||||||||||||||
|
Functions | ||||||||||||||||||||||||||||||||||||
Character classification | ||||||||||||||||||||||||||||||||||||
Character manipulation | ||||||||||||||||||||||||||||||||||||
Conversions to numeric formats | ||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||
String manipulation | ||||||||||||||||||||||||||||||||||||
String examination | ||||||||||||||||||||||||||||||||||||
Character array functions | ||||||||||||||||||||||||||||||||||||
Miscellaneous | ||||||||||||||||||||||||||||||||||||
Defined in header <cstring> | ||
char* strncpy(char* dest,constchar* src,std::size_t count); | ||
Copies at mostcount characters of the byte string pointed to bysrc (including the terminating null character) to character array pointed to bydest.
Ifcount is reached before the entire stringsrc was copied, the resulting character array is not null-terminated.
If, after copying the terminating null character fromsrc,count is not reached, additional null characters are written todest until the total ofcount characters have been written.
If the strings overlap, the behavior is undefined.
Contents |
dest | - | pointer to the character array to copy to |
src | - | pointer to the byte string to copy from |
count | - | maximum number of characters to copy |
dest
Output:
The contents of dest are: h i \0 \0 \0 f
copies one string to another (function)[edit] | |
copies one buffer to another (function)[edit] | |
C documentation forstrncpy |