标签:内存地址 运行 ble clu 角度 bsp 指针 ima com
例:拷贝字符串
#include <stdlib.h> #include <string.h> #include <stdio.h> #pragma warning(disable:4996) void main() { char buf1[100] = {0}; char buf2[100] = {0}; char *p1 = &buf1; char *p2 = &buf2; strcpy(buf1,"abcdef"); while (*p1 != ‘\0‘) { *p2 = *p1; p1++; p2++; } *p2 = *p1; printf("current buf1 is : %s\n",buf1); printf("current buf2 is : %s\n",buf2); system("pause"); }
运行示意图:
运行结果:
标签:内存地址 运行 ble clu 角度 bsp 指针 ima com
原文地址:http://www.cnblogs.com/yongdaimi/p/6763709.html