如何字符*(* ARR)[2]和char **数组[2]彼此有什么不同? [英] how char * (*arr)[2 ] and char **array[2] are different from each other?

查看:115
本文介绍了如何字符*(* ARR)[2]和char **数组[2]彼此有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何的char *(* ARR)[2] 的char **数组[2] 来自不同彼此 ??如果我通过的char *字符串[2] 使用功能,那么如何来访问这两个问题的第一部分中提到的方法中的元素?
也请告诉其他的方式来访问指针数组也元素。
谢谢你。

how char * (*arr)[2] and char **array[2] are different from each other ?? if I am passing char* strings[2] using a function then how to access the elements from both the ways mentioned in first part of question? Please also tell other ways to access elements of pointer array also. Thanks.

推荐答案

CDECL 报告:

char *(*arr)[2]

declare arr as pointer to array 2 of pointer to char

char **arr[2]

declare arr as array 2 of pointer to pointer to char

这只是在 [] 数组声明具有较高的precedence比 * 指针预选赛,所以括号改变的含义。

It's just that the [] array declarator has higher precedence than the * pointer qualifier, so parentheses change the meaning.

这篇关于如何字符*(* ARR)[2]和char **数组[2]彼此有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆