struct tree{

    struct tree *left;

    struct tree *right;

};

 

typedef struct tree newtree;

 

 

int main(int argc, const char * argv[]) {

    // insert code here...

    printf("Hello, World!\n");

    newtree *root = (newtree *)malloc(sizeof(newtree));

    newtree temp;

    printf("%d %d\n", root->left == NULL, temp.left == NULL);  //0 1 || 1 1

    printf("%ld\n", sizeof(newtree));  //每个指针8个字节

    

    return 0;

}

 1. 初步来看结构体,malloc的东西不初始化。声明的局部变量temp是初始化的。

posted on 2017-04-10 14:26  FANNY1995  阅读(156)  评论(0)    收藏  举报