代码实现(环境:Visual Studio 2017)
//1.模拟实现strncat
#include <stdio.h>
#include <windows.h>
#include <string.h>
#include <assert.h>
#pragma warning( disable : 4996)
char * My_strncat(char * dest, const char *src, size_t n)
{
assert(dest);
assert(src);
char *ret = dest;
while (*dest)
{
dest++;
}
while (n--)
{
*dest++ = *src+