Redian新闻
>
difference between: char** p and char*p[] ??
avatar
k*f
2
sizeof的时候是不一样的。
前一个就是一个指针大小,后一个是指针大小乘以指针个数

【在 f******n 的大作中提到】
: rt
avatar
N*n
3

~~~~~~~~~~~~~~~~~~~~~~~~~~
I don't think so.

【在 k****f 的大作中提到】
: sizeof的时候是不一样的。
: 前一个就是一个指针大小,后一个是指针大小乘以指针个数

avatar
N*y
4
He means the size of the pointer that is the element of the array.

【在 N********n 的大作中提到】
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~
: I don't think so.

avatar
L*r
5
kukutf (五脚蟹★酷酷豆腐) is right.
To 32bit OS:
xxx **p is 4
xxx *p[n] is 4 by n
avatar
c*n
6
对阿,一个是指向Char×的指针,一个是数组,区别很大啊。。。
avatar
N*n
7
Actually not much in C or C++.

【在 c*******n 的大作中提到】
: 对阿,一个是指向Char×的指针,一个是数组,区别很大啊。。。
avatar
c*n
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?
avatar
N*n
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?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。