摘要: int main() { //用指针来求一个字符串的长度,不可以使用数组下标的方式 char s1[100] = "hello"; char s2[100] = "world"; char *p = s1; int len=0; while (*p)//相当于*p=="\0" { p++; len++; ... 阅读全文
posted @ 2018-02-11 17:10 唔愛吃蘋果 阅读(403) 评论(0) 推荐(0) 编辑
摘要: //16进制1个和2字符为1个字节,3个支付为2个字节 int a = 0x12345678; char *p = &a; printf("%x\n",*p); p++;//从78移动到56 printf("%x\n", *p); p++;//从56移动到34 printf("%x\n",*p); void ip... 阅读全文
posted @ 2018-02-11 15:35 唔愛吃蘋果 阅读(401) 评论(0) 推荐(0) 编辑