互換性の詳細については、「 Compatibility」を参照してください。 例: char をバッファーにコピーする // crt_strncpy_s_1.cpp // compile with: /MTd // these #defines enable secure template overloads // (see last part of Examples() below) #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <crtdbg.h> // For _CrtSetReport
![strncpy_s、_strncpy_s_l、wcsncpy_s、_wcsncpy_s_l、_mbsncpy_s、_mbsncpy_s_l](https://cdn-ak-scissors.b.st-hatena.com/image/square/d6e4cb632c7025e9f5e05fd314fbf6dcd6144e8d/height=288;version=1;width=512/https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fmedia%2Fopen-graph-image.png)