C语言指针方面的理解:(更新中)位对齐

来源:互联网 发布:js的多级联动下拉菜单 编辑:程序博客网 时间:2024/06/03 09:20

int a=5;
 26     int *q;
 27     q=&a;
 28 cout<<(&q)<<" "<<(&a);

指针指向的地址就是指针指向的东西的首地址
&q==&a;

typedef struct node{
   double data;//8
  // int *a;
   struct node *next[15];//15*4+4
}node_n;//72
typedef struct node{
   double data;//8
  // int *a;
   struct node *next[15];//15*4+4
   int *b;
}node_n;//72

结构体中的数组看出一个整体。位对齐的倍数找最大字节的为标准

原创粉丝点击