请夸大这个声明 [英] Please expplain this declaration

查看:64
本文介绍了请夸大这个声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释这个函数指针声明:


float(* getptr(char操作码))(int,int);


我对语法感到困惑 - 我还没有看到带有

的函数指针额外的参数char opcode在括号中。


谢谢,

fred。

Can someone please explain this function pointer declaration:

float (* getptr (char opcode) ) (int, int);

I''m confused by the syntax - I have not seen a function pointer with
the extra parameter "char opcode" in the parentheses.

Thanks,
fred.

推荐答案

在文章< 11 ********************* @ w5g2000hsg.googlegroups.c om>,

< fr * ********@gmail.com写道:
In article <11*********************@w5g2000hsg.googlegroups.c om>,
<fr*********@gmail.comwrote:

>有人可以解释这个函数指针声明:

float( * getptr(char opcode))(int,int);
>Can someone please explain this function pointer declaration:

float (* getptr (char opcode) ) (int, int);



它将getptr声明为一个函数,它接受一个名为opcode的char参数
并返回一个带有两个整数和

返回一个浮点数。

It declares getptr as a function taking a char argument called opcode
and returning a pointer to a function taking two integers and
returning a float.


>我对语法感到困惑 - 我还没有看到一个带有
额外功能的指针参数char opcode在括号中。
>I''m confused by the syntax - I have not seen a function pointer with
the extra parameter "char opcode" in the parentheses.



这不是额外参数 - 这是

声明的普通部分!


float(* ...)(int,int)


缠绕它描述了返回类型。


- 理查德


-

考虑到需要多达32个字符" - 1963年的X3.4。

That''s not an "extra parameter" - that''s the ordinary part of the
declaration! The

float (* ... ) (int, int)

wrapped around it is describing the return type.

-- Richard

--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.


fr **** *****@gmail.com 写道:
fr*********@gmail.com writes:

有人可以解释这个函数指针声明:


float(* getptr(char操作码))(int,int);


我对语法感到困惑 - 我还没有看到一个带有
的函数指针
额外参数char opcode在括号中。
Can someone please explain this function pointer declaration:

float (* getptr (char opcode) ) (int, int);

I''m confused by the syntax - I have not seen a function pointer with
the extra parameter "char opcode" in the parentheses.



这不是函数指针的声明。这是一个名为getptr的函数的

声明。获取char类型的单个

参数并返回指向函数的指针

获取两个int参数并返回一个浮点数。

-

Comp-sci预计在2007年底之前获得博士学位

在2008年寻求加州*以外的工业或学术职位

This is not a declaration of a function pointer. It is a
declaration of a function named "getptr" taking a single
parameter of type char and returning a pointer to a function
taking two int parameters and returning a float.
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008


5月10日上午9:33,Ben Pfaff< b ... @ cs.stanford.eduwrote:
On May 10, 9:33 am, Ben Pfaff <b...@cs.stanford.eduwrote:

fred.zak ... @ gmail.com写道:
fred.zak...@gmail.com writes:

有人可以解释一下这个函数指针声明:
Can someone please explain this function pointer declaration:


float(* getptr(char opcode))(int,int);
float (* getptr (char opcode) ) (int, int);


我对语法感到困惑 - 我还没有看到一个带有

的函数指针的额外参数" char操作码在括号中。
I''m confused by the syntax - I have not seen a function pointer with
the extra parameter "char opcode" in the parentheses.



这不是函数指针的声明。这是一个名为getptr的函数的

声明。获取char类型的单个

参数并返回指向函数的指针

获取两个int参数并返回一个浮点数。

-

Comp-sci博士预计在2007年底之前

寻求工业或学术职位*在加利福尼亚州*之外* 2008年


This is not a declaration of a function pointer. It is a
declaration of a function named "getptr" taking a single
parameter of type char and returning a pointer to a function
taking two int parameters and returning a float.
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008



非常感谢你们的回答!

fred。


Thanks very much for the answers guys!
fred.


这篇关于请夸大这个声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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