Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 找不到这些(*)指针表达式的含义_C - Fatal编程技术网

C 找不到这些(*)指针表达式的含义

C 找不到这些(*)指针表达式的含义,c,C,我在某处找到了这些表达式,但我无法通过示例或其他方式找到任何有效的搜索结果来了解它们,这意味着什么: (*)[15] //how is this defined/used 及 第二个是函数指针,但结尾的[1]是什么意思 fun // fun is... *fun // a pointer to... (*fun) (*fun)(int) // a function with an `int` parameter,

我在某处找到了这些表达式,但我无法通过示例或其他方式找到任何有效的搜索结果来了解它们,这意味着什么:

(*)[15]  //how is this defined/used

第二个是函数指针,但结尾的[1]是什么意思

      fun          // fun is...
     *fun          // a pointer to...
    (*fun)
    (*fun)(int)    // a function with an `int` parameter, returning...
    (*fun)(int)[1] // an array of size 1 of ...
int (*fun)(int)[1] // int

函数无法返回数组,因此此类型无效,无法在C程序中使用。

您可能喜欢网站cdecl.org,它可以在人类可读和C语法之间转换。例如,您的第二个声明转换为声明fun作为指向函数int的指针返回int的数组1,这将做什么*[15]@AgrudgeAmicus指向大小为15的数组的指针,您需要在左侧添加一个类型。变量名在*后面。
      fun          // fun is...
     *fun          // a pointer to...
    (*fun)
    (*fun)(int)    // a function with an `int` parameter, returning...
    (*fun)(int)[1] // an array of size 1 of ...
int (*fun)(int)[1] // int