遇到"identifier not found"问题
Having issue with "identifier not found"
我正在学习c++,我得到"process_teleport_menu"标识符未找到"错误,我知道在C中,一切都必须在使用前声明。这是一段代码:
if (bDown)
{
menu_beep();
activeLineIndexPlayer2++;
if (activeLineIndexPlayer2 == lineCount)
activeLineIndexPlayer2 = 0;
waitTime = 150;
}else
if (bRight)
{
menu_beep();
if (activeLineIndexPlayer2 = process_teleport_menu()) //Error
activeLineIndexPlayer2 = 0;
}
}
return false;
}
int teleportActiveLineIndex = 0;
bool process_teleport_menu()
{
const float lineWidth = 250.0;
const int lineCount = 17;
还有别的办法吗?
在声明process_teleport_menu()
函数之前使用它。您可以在定义函数之前声明它,以便在使用它之前指出它的存在:将bool process_teleport_menu();
放在包含麻烦代码的函数之前,这样应该可以工作,除非它不是您的全部问题。
然而,这个问题在大多数c++教程中都有答案,所以请在提出另一个基本问题之前先阅读一篇。
相关文章:
- 警告处理为错误这里有什么问题
- 最小硬币更换问题(自上而下方法)
- 为"adjacent"变量赋值时出现问题
- 我的神经网络不起作用 [XOR 问题]
- 在Ubuntu 16.04上安装Cilk时出现问题
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 编译包含字符串的代码时遇到问题
- Project Euler问题4的错误解决方案
- 问题:什么是QAbstractItemView::NoEditTriggers的反面
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 在进程中对同一管道进行读取和写入时C++管道出现问题
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++ 雷神库 - 使用资源加载器类时出现问题(不命名类型)
- 一个关于在C++中重载布尔运算符的问题
- 首要问题的答案让值班员搞错了
- setlocale的C++土耳其字符串问题
- 如何重构类层次结构以避免菱形问题
- 为英特尔C++编辑器"GCC not found"设置环境变量时出现问题
- 打开文件时基于 Qt 的应用程序'Qt platform plugin windows not found'问题
- 遇到"identifier not found"问题