编译类时出现"Identifier not found"错误

Getting an "Identifier not found" error on compiling a class

本文关键字:Identifier not found 错误 编译      更新时间:2023-10-16

粘贴到的链接

我不确定我在这里做错了什么。它只是不允许我访问getTypeEffective函数——就像我要么拼错了它,要么还没有写出来。有什么想法吗?

查看第21行。您将原型定义为"double getEffective(TYPING,TYPING);"

它应该是"double getTypeEffective(TYPING,TYPING);"

在使用函数之前需要声明它,如下所示:

double getTypeEffectiveness(TYPING attack, TYPING defend);

(或者只是将定义移动到您使用它的位置上方)。

getTypeEffective与getEffective