Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5299
  • 博文数量: 2
  • 博客积分: 65
  • 博客等级: 民兵
  • 技术积分: 30
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-29 17:07
文章分类
文章存档

2013年(2)

我的朋友
最近访客

分类: C/C++

2013-03-26 10:41:29

int *daytab[13];    // 1)an array of 13 pointers to integers
int (*daytab)[13];    // 2)a pointer to an array of 13 integers

I express the two types of declaration according operator priority:

int a[10];    //every member of array a is an int, it has 10 members
since operator [] is more previleged than * ,so in the case 1), it is equal to
int *(daytab[13]);
daytab[13] is an array of which every member is of the same type, and then we discover the type is pointers to int,so it's an array of pointers.

In the latter case, (*datab) is recognised firt, so daytab is a pointer to a certain type, and then we discover the type is int[13], so it's a pointer to arrays.
阅读(166) | 评论(0) | 转发(0) |
0

上一篇:Why inode numbers start from 1?

下一篇:没有了

给主人留下些什么吧!~~