简体   繁体   English

- int *p() - 在 c 中是什么意思?

[英]What does - int *p() - mean in c?

What does this definition mean in C language?这个定义在C语言中是什么意思? A pointer to what?指向什么的指针?

int  *a();
int  *a();

is the declaration of a function that takes an unspecified (but fixed) number of arguments and returns an int * .是一个函数的声明,它采用未指定(但固定)数量的参数并返回一个int *

It is different than:它不同于:

int *a(void);

which is the declaration of a function that takes no argument and returns an int * .这是一个不带参数并返回int *的函数的声明。

The former declaration is an obsolescent feature, use the second form to declare a function with no parameter.前一种声明是一个过时的特性,使用第二种形式来声明一个没有参数的函数。

you can use the cdecl command by typing您可以通过键入来使用cdecl命令

explain int  *a()

and you will get你会得到

cdecl> explain int  *a()
declare a as function returning pointer to int

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM