视觉如何修复错误E0026 C
visual how to fix error E0026 c++
我不知道如何用/给予解决此错误命令是一个简单的char命令;但是无论如何,我的错误是"字符常数太多"如果我拿走e的更新,请点击我不想
system("pause")
if (GetAsyncKeyState(VK_RETURN))
{
cin >> command >> argument >> argument1;
cin.clear();
if (command == '/tp')
{
if (map[argument][argument1] == ' ')
{
map[y][x] = ' ';
int y = argument;
int x = argument1;
map[y][x] = '@';
}
}
if (command == '/give')
{
}
c/ C++
中的单个字符被 '
'
char c = 'h';
事物的字符串被"
"
char * s = "hello";
std::string ss = "hello";
当美国的家伙发现其他语言和脚本时,这变得更加复杂。char的256个值不足以允许常规字符。然后,他们允许'
'
中的少量额外值定义扩展字符值。
看起来您需要字符串。假设command
是std::string
,那么代码应该是...
if (GetAsyncKeyState(VK_RETURN))
{
cin >> command >> argument >> argument1;
cin.clear();
if (command == "/tp")
{
if (map[argument][argument1] == ' ')
{
map[y][x] = ' ';
int y = argument;
int x = argument1;
map[y][x] = '@';
}
}
if (command == "/give")
{
}
}
command
需要是具有多个字符并为其定义的operator >>
的能力。
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- 代码在main()中运行,但在函数中出现错误
- 释放错误后堆使用
- (C++)分析树以计算返回错误值的简单算术表达式
- Project Euler问题4的错误解决方案
- 我的字符计数代码计算错误.为什么
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 尝试导入pybind-opencv模块时出现libgtk错误
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 在某些循环内使用vector.push_back时出现分段错误
- MSVC多行宏编译器错误
- 静态数据成员的问题-修复链接错误会导致编译器错误
- 为什么在运行时没有向我们提供有关分段错误的更多信息?
- 视觉如何修复错误E0026 C