strcpy的:实现方法 [英] strcpy : Implementation method
本文介绍了strcpy的:实现方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在经历一个可能的实现方法库函数的strcpy
。它是:
I was going through a possible implementation method for library function strcpy
. It is :
void strcpy(char *src, char *dest)
{
while (*dest++ = *src++)
;
}
这怎么可能没有的检查工作'\\ 0'
??
推荐答案
* DEST ++ = * SRC ++
是的价值* SRC的结果
的src
的增量之前。如果此值 \\ 0
,循环终止。
The result of *dest++ = *src++
is the value of *src
before the increment of src
. If this value is \0
, the loop terminates.
这篇关于strcpy的:实现方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文