摘要: #include #include #include int main() { char* p = "123"; printf("%d\n", sizeof(p));//4 printf("%d\n", strlen(p));//3 std::cout << p + 1;//"23" return 0; } 阅读全文
posted @ 2017-01-04 22:32 zzyoucan 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #include int main() { int a = 90; int*p = &a; printf("%p\n", p);//0138FE90 int* b = p + 1;//此处指针加1,移动4个字节,所以指针的值加4 printf("%p\n", b);//0138FE94 int c = b - p;//... 阅读全文
posted @ 2017-01-04 22:17 zzyoucan 阅读(123) 评论(0) 推荐(0) 编辑