sstrcpy.c

来自「国外网站上的一些精典的C程序」· C语言 代码 · 共 27 行

C
27
字号
/***  strcpy() and strcat() work-alikes which allow overlapping buffers.*/#include <string.h>#include "snip_str.h"#if defined(__cplusplus) && __cplusplus extern "C" {#endifchar *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 + -
显示快捷键?