tstrncpy.c
来自「单片及c语言轻松入门的随书光盘」· C语言 代码 · 共 12 行
C
12 行
#include <string.h>
void tst_strncpy ( char *s) {
char buf [21];
strncpy (buf, s, sizeof (buf));
buf [sizeof (buf)] = '\0';
}
void main()
{ char buf[]="This is a Test!";
for(;;)
tst_strncpy(buf);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?