f******n 发帖数: 90 | |
k****f 发帖数: 3794 | 2 sizeof的时候是不一样的。
前一个就是一个指针大小,后一个是指针大小乘以指针个数
【在 f******n 的大作中提到】 : rt
|
N********n 发帖数: 8363 | 3
~~~~~~~~~~~~~~~~~~~~~~~~~~
I don't think so.
【在 k****f 的大作中提到】 : sizeof的时候是不一样的。 : 前一个就是一个指针大小,后一个是指针大小乘以指针个数
|
N*********y 发帖数: 105 | 4 He means the size of the pointer that is the element of the array.
【在 N********n 的大作中提到】 : : ~~~~~~~~~~~~~~~~~~~~~~~~~~ : I don't think so.
|
L*********r 发帖数: 92 | 5 kukutf (五脚蟹★酷酷豆腐) is right.
To 32bit OS:
xxx **p is 4
xxx *p[n] is 4 by n |
c*******n 发帖数: 112 | 6 对阿,一个是指向Char×的指针,一个是数组,区别很大啊。。。 |
N********n 发帖数: 8363 | 7 Actually not much in C or C++.
【在 c*******n 的大作中提到】 : 对阿,一个是指向Char×的指针,一个是数组,区别很大啊。。。
|
c*******n 发帖数: 112 | 8 do not know what you are talking about. They are conceptlly different. Can
you said that a pointer is the same as a array? |
N********n 发帖数: 8363 | 9
What I mean is when you declare an array without either specifying its
size or initializing its content (which is what the topic suggests and
typical in function parameter declaration), it's basically a pointer.
Say a fucntion is defined as:
void foo (XXX a[])
"sizeof(a)" within this foo function forever produces "sizeof(XXX *)"
instead of the actual size of the parameter a.
【在 c*******n 的大作中提到】 : do not know what you are talking about. They are conceptlly different. Can : you said that a pointer is the same as a array?
|