sstrcpy.c

来自「C语言库函数的源代码,是C语言学习参考的好文档。」· C语言 代码 · 共 29 行

C
29
字号
/* +++Date last modified: 05-Jul-1997 */

/*
**  strcpy() and strcat() work-alikes which allow overlapping buffers.
*/

#include <string.h>
#include "snip_str.h"

#if defined(__cplusplus) && __cplusplus
 extern "C" {
#endif

char *sstrcpy(char *to, char *from)
{
    memmove(to, from, 1+strlen(from));
    return to;
}

char *sstrcat(char *to, char *from)
{
    sstrcpy(to + strlen(to), from);
    return to;
}

#if defined(__cplusplus) && __cplusplus
 }
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?