strncpyworks with an array of characters, and it works great in C ++, as well as in C.
If you use a strncpycharacter array in C ++, and this doesn't work, perhaps due to some error in your C ++ code: show us if you want some help.
(.. std::string), , :
std::string a = "hello!";
. , , strncpy: , .
, : std::string , n , , .