由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - int *a [] 和int (*a)[] 一样吗
相关主题
JHQ的一道指针题。C 语言,初学者问题(4),读取字符指针内容
谁给解释一下这个c questionWhat is wrong in this array declaration.
数组指针的问题数组问题
如何让一个指针指向一个多维数组怎么得到char *分配空间的大小?
Smart Parser/Compiler Development程序中的各个变量/数组的内存地址是否会混在一起?
请教一个pointer的问题a question of perl
一道很奇怪的面试题const char *p, is it ok to change p[1] ?
C一个问题搞不懂int F::*x = &F::x是什么意思?
相关话题的讨论汇总
话题: int话题: declare话题: 一样话题: pointer话题: array
进入Programming版参与讨论
1 (共1页)
o**********a
发帖数: 330
1
多谢
t****t
发帖数: 6806
2
no

【在 o**********a 的大作中提到】
: 多谢
Z*****Z
发帖数: 723
3
赞精简

【在 t****t 的大作中提到】
: no
l********a
发帖数: 1154
4
指针数组和数组指针
参考这个帖子
http://www.mitbbs.com/article_t/Programming/31223047.html
D*****r
发帖数: 6791
5
cdecl.org
int* a[] ==> declare a as array of pointer to int
int (*a) [] ==> declare a as pointer to array of int

【在 o**********a 的大作中提到】
: 多谢
j*****I
发帖数: 2626
6
大侠能否讲讲一个compiler看到这个expression 怎么开始分析的?
elements有以下这些,
int
*
a
[]
第一个比较清楚. 第二个好像既不是那么清楚了. 那个element先被读,那个后被读呢?

【在 D*****r 的大作中提到】
: cdecl.org
: int* a[] ==> declare a as array of pointer to int
: int (*a) [] ==> declare a as pointer to array of int

A******g
发帖数: 612
7
you mean int(*a)[] == int a[] ?

【在 D*****r 的大作中提到】
: cdecl.org
: int* a[] ==> declare a as array of pointer to int
: int (*a) [] ==> declare a as pointer to array of int

D*****r
发帖数: 6791
8
我觉得是先;,然后int, 然后[], 然后(),然后*,然后a
具体的照着parser规则走一遍,画出Abstract syntax tree就明白了。
www.lysator.liu.se/c/ANSI-C-grammar-y.html

呢?

【在 j*****I 的大作中提到】
: 大侠能否讲讲一个compiler看到这个expression 怎么开始分析的?
: elements有以下这些,
: int
: *
: a
: []
: 第一个比较清楚. 第二个好像既不是那么清楚了. 那个element先被读,那个后被读呢?

j*****I
发帖数: 2626
9
找到个blog可以帮助入门了...
http://eli.thegreenplace.net/2009/02/16/abstract-vs-concrete-sy

【在 D*****r 的大作中提到】
: 我觉得是先;,然后int, 然后[], 然后(),然后*,然后a
: 具体的照着parser规则走一遍,画出Abstract syntax tree就明白了。
: www.lysator.liu.se/c/ANSI-C-grammar-y.html
:
: 呢?

1 (共1页)
进入Programming版参与讨论
相关主题
int F::*x = &F::x是什么意思?Smart Parser/Compiler Development
不如各位高手挑个专题讲讲C++11吧请教一个pointer的问题
Question about a C++ compilation error on Visual Studio 2005一道很奇怪的面试题
a simple questionC一个问题搞不懂
JHQ的一道指针题。C 语言,初学者问题(4),读取字符指针内容
谁给解释一下这个c questionWhat is wrong in this array declaration.
数组指针的问题数组问题
如何让一个指针指向一个多维数组怎么得到char *分配空间的大小?
相关话题的讨论汇总
话题: int话题: declare话题: 一样话题: pointer话题: array