问个C指针的问题

majia041

新手上路
注册
2003-04-14
消息
106
荣誉分数
0
声望点数
0
char ** c 和 char * c[] 在定义上和使用上有什么区别
我知道在很多情况下这2个东西是通用的,但我觉得2者之间还是有区别。
希望dx指教。
谢谢。
 
char* c[]? do you need do that? I think char c[] is ok, c means pointer
 
you :D what a? I wrong le ma?

:blink:
 
不干啥,我不懂C,看你回答,我知道一定对,我欣慰的笑了 :rolleyes:
 
:D :D :D

最初由 Rabbit 发布
不干啥,我不懂C,看你回答,我知道一定对,我欣慰的笑了 :rolleyes:
 
现在还有人用C????????????????????????????????:flaming:
 
俺不懂C,只是相帮顶一下,
jue fei e yi guaan shui.
:blowzy: :D
最初由 majia041 发布
xie xie hui fu
dan ju jue guan shui.
 
有人正经回答这个问题吗?
灌水就真的不要了
失眠夜那刨坑的人很多,去那里好了。
 
In my perspective,the first case char** c is a pointer to pointer.In this case,c contains an address which points to a second address,which points to a character.

The second one char *c[] is a pointer to a pointer array which contains pointers point to different charactor.

Since an array name is a pointer itself,so in this mannar the c in the first case could point to an array which contains pointers point to charactors,which is the second case,but it also might be other things,i.e,other data structures like Queue,etc.Both of them are pointer to pointer case,looks like you are a little bit confused in using of pointer.

Well,talk a bit much,how about an illustration :D Hope it works for you,good luck!
 
Type is different. .Try to use the sizeof(), you shall get a difference.

But in real coding, there is not much difference expect the sizeof() from my experience using the C.
 
后退
顶部