char(*p)[15];
char(*p)(int *a);
int(*pt)(char*);
int *pt(char*);
有人帮忙吗?
基本规则:从标识符开始,可以时右读,必须时左读。
- 从标识符*开始。说出来,然后是“是”。将您的“左脚”放在其左侧一个字符。
- Read rightwards until you hit the end or a
)
. Put your "right foot" one character to the right of where that )
is, if that's what you hit.
- 如果你看到
[42]
当你向右阅读时,说“42 的数组”。
- 如果您看到
(
当你读到的时候向右,说“函数获取”,然后递归说出每个参数的类型(但省略参数名称本身),然后是“并返回”。
- Now hop onto your left foot and read leftwards until you hit the start or a
(
. Put your left foot one character to the left of the (
if that's what you hit.
- 如果您看到
*
or a &
当你向左阅读时,说“指向”或“引用”。
- 您看到的任何其他内容(例如
const
, int
, MyFoo
),就说吧。
- 如果你点击了开始,你就完成了。否则,跳回右脚并转到 2。
* 如果没有标识符,想象一下它必须去哪里——我知道这很棘手,但只有一个合法的位置。
遵循以下规则:
- p 是指向 15 个字符的数组的指针
- p 是一个指向函数的指针,该函数接受指向 int 的指针并返回 char
- pt 是一个指向函数的指针,该函数接受指向 char 的指针并返回 int
- pt 是一个函数,它接受指向 char 的指针并返回指向 int 的指针
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)