使用C ,我不断获得我似乎无法避免的可变错误的重新定义
Using c++ I keep getting a redefinition of variable error that I cannot seem to avoid
我想做的代码要做
代码应接受用户的int值,并比较其尺寸。如果u
中的值小于或等于l
中的值,则将Truth
打印到控制台。
错误
IDE(Xcode 9.1)不断给我这个错误
Redefinition of u
如何更正此?
#include <iostream>
using namespace std;
int main() {
int u, l;
cout << "Enter value : n";
cin >> u;
cout << "Enter next value : n";
cin >> l;
if (u<=l) {
cout << "Truth";
}
}
对于代码来说应该没有问题尝试再次创建一个新项目,也许您在某个地方定义了" U"
这个问题是我在代码中有一个全局 u
。我删除了它。
相关文章:
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 在没有定义返回类型的函数中返回布尔值,并将结果保存在无错误的char编译中-为什么
- 使用命名空间时出现多个定义错误
- C++错误C2600:无法定义编译器生成的特殊成员函数(必须首先在类中声明)
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- 编写代码时C++出现错误:错误 1 错误 C2601:'circle':本地函数定义是非法的
- 在运算符重载定义中使用成员函数(const错误)
- 尝试调用 .h 文件中定义的变量时出现变量未定义错误
- 在C++中使用内联方法时出现未定义的符号错误
- 已定义函数时出现 G++ "未定义的引用"错误
- C++ G++ 编译器 - 错误:隐式声明的定义
- 链接 cmake 时出现未定义的引用错误
- 在头文件和 cpp 文件中使用一次 #pragma 时出现结构重定义错误
- 错误:未定义对'oboe::AudioStreamBuilder::openStream(oboe::AudioStream**)'的引用
- 链接阶段出现多重定义错误
- 已经以性格错误定义了
- vim ctag导致了对乐趣的错误定义
- C++ 隐式声明的编译器错误定义
- 编译器错误-定义问题.C++