int main() {
    char *p1 = "hello";
    char *p2 = "hello";
    char p3[] = "hello";

    printf("%p\n%p\n%p\n%p", p1, p2, p3,main);
    return 0;
}

 

编译好之后,p1 p2的打印值,每次都是固定的。是代码段中的"hello"存放位置。

p3每次不一样。

posted on 2017-12-19 20:52  newbird2017  阅读(95)  评论(0)    收藏  举报