简体   繁体   English

函数指针类型的Typedef

[英]Typedefs for function pointer type

I got a typedef function pointer type defined as 我有一个typedef函数指针类型定义为

typedef double(*fun)(const eValue&);

why is this line throwing an error: missing type specifier -int assumed? 为什么此行引发错误:假定缺少类型说明符-int? and syntax error: missing , before '&'? 和语法错误:在&之前缺少?

can anyone help me? 谁能帮我?

Thanks in advance. 提前致谢。

The reason likely is that eValue is undefined. 原因可能是eValue未定义。

Assuming it is an enum (just guessing from its name) try 假设它是一个enum (仅根据其名称进行猜测),请尝试

enum eValue;
typedef double(*fun)(const eValue&);

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

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