|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include <stdio.h>
- #include <string.h>
- int main(void)
- {
- char src[] = "******************************";
- char dest[] = "abcdefghijlkmnopqrstuvwxyz0123456709";
- char *ptr;
- printf("destination before memcpy: %s\n", dest);
- ptr = memcpy(dest, src, strlen(src));
- if (ptr)
- printf("destination after memcpy: %s\n", dest);
- else
- printf("memcpy failed\n");
- return 0;
- }
复制代码
这段代码报错的原因是什么啊,
- #include <stdio.h>
- #include <stdio.h>
- #include <string.h>
- int main(void)
- {
- char src[] = "******************************";
- char dest[] = "abcdefghijlkmnopqrstuvwxyz0123456709";
- char *ptr;
- printf("destination before memcpy: %s\n", dest);
- ptr =(char*) memcpy(dest, src, strlen(src));
- if (ptr)
- printf("destination after memcpy: %s\n", dest);
- else
- printf("memcpy failed\n");
- return 0;
- }
复制代码
这个意思吗?
|
|