代码如下:
#include<stdio.h>
/*模拟实现strcpy */
char* Strcpy(char * dest, const char * src) {
int i = 0;
for (; src[i] != '\0'; ++i) {
dest[i] = src[i];
}
dest[i] = '\0';
}
int main() {
char* p = "abcdef";
char str[6] = { 0 };
Strcpy(str, p);
printf("%s\n", str);
system("pause");
return 0;
}