user-0 提问: 为什么这段代码的结果为空（代码在VS2017编译器下运行的）

回复:
user: user-0
content: 谢谢热心的你们吗

user: user-1
content: 引用 3 楼 zhao4zhong1 的回复:[quote=引用 2 楼 cfjtaishan 的回复:] strcat_s参数不对，缺少参数； #include"stdafx.h" #include<stdio.h> #include<string.h> int main() { char str1[30] = {"People's Republic of"}; char str2[] = {"China"}; printf("%s\n", strcat_s(str1, 30， str2));         return 0; }  看看楼上MSDN节选中strcat_s的返回值是啥吧！想当然害死人的。[/quote] 它和strcat不一样呗，不一样的库。  #include"stdafx.h" #include<stdio.h> #include<string.h> int main() { char str1[30] = {"People's Republic of"}; char str2[] = {"China"}; strcat_s(str1, 30， str2); printf("%s\n", str1);         return 0; }

user: user-2
content: 引用 2 楼 cfjtaishan 的回复:strcat_s参数不对，缺少参数； #include"stdafx.h" #include<stdio.h> #include<string.h> int main() { char str1[30] = {"People's Republic of"}; char str2[] = {"China"}; printf("%s\n", strcat_s(str1, 30， str2));         return 0; }  看看楼上MSDN节选中strcat_s的返回值是啥吧！想当然害死人的。

user: user-1
content: strcat_s参数不对，缺少参数； #include"stdafx.h" #include<stdio.h> #include<string.h> int main() { char str1[30] = {"People's Republic of"}; char str2[] = {"China"}; printf("%s\n", strcat_s(str1, 30， str2));         return 0; }

user: user-2
content: Collapse AllExpand All      Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: J# Code: JScript   Visual Basic C# Visual C++ J# JScript Run-Time Library Reference  strcat_s, wcscat_s, _mbscat_s  Example  See Also  Send Feedback     Append a string. These are versions of strcat, wcscat, _mbscat with security enhancements as described in Security Enhancements in the CRT.    errno_t strcat_s(    char *strDestination,    size_t numberOfElements,    const char *strSource  ); errno_t wcscat_s(    wchar_t *strDestination,    size_t numberOfElements,    const wchar_t *strSource  ); errno_t _mbscat_s(    unsigned char *strDestination,    size_t numberOfElements,    const unsigned char *strSource  ); template <size_t size> errno_t strcat_s(    char (&strDestination)[size],    const char *strSource  ); // C++ only template <size_t size> errno_t wcscat_s(    wchar_t (&strDestination)[size],    const wchar_t *strSource  ); // C++ only template <size_t size> errno_t _mbscat_s(    unsigned char (&strDestination)[size],    const unsigned char *strSource  ); // C++ only    Parameters strDestination Null-terminated destination string buffer.  numberOfElements Size of the destination string buffer.  strSource Null-terminated source string buffer.  Return Value Zero if successful; an error code on failure.  strDestination  numberOfElements  strSource  Return value  Contents of strDestination   NULL or unterminated  any  any  EINVAL  not modified   any  any  NULL  EINVAL  strDestination[0] set to 0   any  0, or too small  any  ERANGE  strDestination[0] set to 0    Remarks The strcat_s function appends strSource to strDestination and terminates the resulting string with a null character. The initial character of strSource overwrites the terminating null character of strDestination. The behavior of strcat_s is undefined if the source and destination strings overlap.  Note that the second parameter is the total size of the buffer, not the remaining size:    Copy Code  char buf[16]; strcpy_s(buf, 16, "Start"); strcat_s(buf, 16, " End");               // Correct strcat_s(buf, 16 – strlen(buf), " End"); // Incorrect    wcscat_s and _mbscat_s are wide-character and multibyte-character versions of strcat_s. The arguments and return value of wcscat_s are wide-character strings; those of _mbscat_s are multibyte-character strings. These three functions behave identically otherwise.  If strDestination is a null pointer, or is not null-terminated, or if strSource is a NULL pointer, or if the destination string is too small, the invalid parameter handler is invoked, as described in Parameter Validation . If execution is allowed to continue, these functions return EINVAL and set errno to EINVAL.  In C++, using these functions is simplified by template overloads; the overloads can infer buffer length automatically (eliminating the need to specify a size argument) and they can automatically replace older, non-secure functions with their newer, secure counterparts. For more information, see Secure Template Overloads.  The debug versions of these functions first fill the buffer with 0xFD. To disable this behavior, use _CrtSetDebugFillThreshold.  TCHAR.H routine   _UNICODE & _MBCS not defined  _MBCS defined  _UNICODE defined   _tcscat_s  strcat_s  _mbscat_s  wcscat_s    Requirements Routine  Required header   strcat_s  <string.h>   wcscat_s  <string.h> or <wchar.h>   _mbscat_s  <mbstring.h>    For additional compatibility information, see Compatibility in the Introduction.  Example See the code example in strcpy_s, wcscpy_s, _mbscpy_s.  .NET Framework Equivalent System::String::Concat  See Also Concepts String Manipulation (CRT) strncat, _strncat_l, wcsncat, wcsncat_l, _mbsncat _mbsncat_l strncmp, wcsncmp, _mbsncmp, _mbsncmp_l strncpy, _strncpy_l, wcsncpy, _wcsncpy_l, _mbsncpy, _mbsncpy_l _strnicmp, _wcsnicmp, _mbsnicmp, _strnicmp_l, _wcsnicmp_l, _mbsnicmp_l strrchr, wcsrchr, _mbsrchr, _mbsrchr_l strspn, wcsspn, _mbsspn, _mbsspn_l Send feedback on this topic to Microsoft.  #include <stdio.h> #include <string.h> int main() {     char str1[30] = "People's Republic of";     char str2[] = "China";     strcat_s(str1, 30, str2);     printf("%s\n", str1);     return 0; } //People's Republic ofChina //