原因 各种各样的标准库函数在将字节序列从一个存储区复制到另一个存储区的作用之中。 当源区域和目标区域重叠时,这些功能大多数都具有不确定的行为。 #include <string.h> /* for memcpy() */ char str[19] = "This is an example"; memcpy(str + 7, str, 10)