cstring:strcpy、strncpy、strncpy、strncpy_s
一、strcpy
Dest和Source的长度需要一样大
二、strncpy
_Count表示Source的长度
三、strcpy_s
这里是将source中所有的内容都复制到destination中,所以_SizeInBytes==len(_Source);不然会出错,也就是多了不行,少了也不行
四、strncpy_s
这里要求_MaxCount == _SizeInBytes;//因为在复制完前_MaxCount 个source后会在Destination的第_SizeInBytes中,也就是最后一个赋值为’\0’;
如果_MaxCount < _SizeInBytes-1中间会复制?
否则异常;