如何用typdef定义一个函数指针变量? [英] how to define a function pointer variable witout typdef?
问题描述
大家好,
typedef int(* pfunc)(int,int);
pfunc a_func;
i知道它没关系,
但如何在没有typedef语句的情况下定义a_func?
谢谢。
鲍曼@潘
baumann @ pan写道:大家好,
typedef int(* pfunc)(int,int);
pfunc a_func;
我知道它没关系,
int(* a_func)(int,int);
Rob Gamble
baumann @ pan写道:大家好,
typedef int(* pfunc )(int,int);
pfunc a_func;
我知道它没关系,
但是如何在没有typedef语句的情况下定义a_func?
int(* a_func)(int,int);
cdecl<< EOD
说明int(* a_func)(int,int)
退出
EOD
声明a_func为指向函数(int,int)的指针返回int
" baumann @ pan" < BA ********* @ gmail.com>在消息新闻中写道:11 ********************** @ o13g2000cwo.googlegr oups.com ...大家好,
typedef int(* pfunc)(int,int);
pfunc a_func;
我知道它没关系,
但如何在没有typedef语句的情况下定义a_func?
谢谢。
int(* a_func)(int,int);
但这不是一个宣言。
-
组合是国际象棋的核心
A.Alekhine
邮寄地址:
sathyashrayan at gmail DOT com
hi all,
typedef int (*pfunc)(int , int);
pfunc a_func;
i know it''s ok,
but how can define a_func without typedef statement?
thanks .
baumann@pan
解决方案baumann@pan wrote:hi all,
typedef int (*pfunc)(int , int);
pfunc a_func;
i know it''s ok,
but how can define a_func without typedef statement?
int (*a_func)(int, int);
Rob Gamble
baumann@pan wrote:hi all,
typedef int (*pfunc)(int , int);
pfunc a_func;
i know it''s ok,
but how can define a_func without typedef statement?
int (*a_func)(int, int);
cdecl <<EOD
explain int (*a_func)(int, int)
quit
EOD
declare a_func as pointer to function (int, int) returning int
"baumann@pan" <ba*********@gmail.com> wrote in message news:11**********************@o13g2000cwo.googlegr oups.com...hi all,
typedef int (*pfunc)(int , int);
pfunc a_func;
i know it''s ok,
but how can define a_func without typedef statement?
thanks .
int (*a_func)(int, int);
But this is a declaration not a definition.
--
"combination is the heart of chess"
A.Alekhine
Mail to:
sathyashrayan AT gmail DOT com
这篇关于如何用typdef定义一个函数指针变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!