字符串一级指针内存模型

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
    char buf[20] = "aaaa"; //定义并初始化
    char buf2[] = "bbbb";
    char *p1 = "111111";
    char *p2 = (char *)malloc(100);
    strcpy(p2, "3333");

    return 0;

}

posted @ 2017-04-09 16:26  Liu_Jing  Views(144)  Comments(0)    收藏  举报