令牌之前'||'预期主表达式出错
Error expected primary-expression before '||' token
目前试图完成我的c++分配,代码还不完整,但我只是试图编译它,我遇到了这个错误。我似乎不知道如何修复它,任何指针?请原谅这个超级菜鸟的问题…我还是入门课程的初学者。
代码你的括号乱了。c++中的if
语句条件应该像这样用圆括号括起来:
if ( animal == 'D' || animal == 'd' )...
if ( status == 'Y' || status == 'y' )...
else if ( status == 'N' || status == 'n')...
你的条件必须用单括号括起来
if ((animal == 'D') || (animal == 'd'))
,
if((status == 'Y) || (status == 'y))
,
else if((status == 'N') || (status == 'n'))
你的If语法错了,亲爱的。你漏掉了圆括号。应该是:
if((status == 'N') || (status == 'n'))
相关文章:
- (C++)分析树以计算返回错误值的简单算术表达式
- 访问者访问变体并返回不同类型时出错
- 在Linux for Windows上编译C++代码时出错
- 读取文件的最后一行并输入到链接列表时出错
- 重载操作程序时出错>>用于类中的字符串 memebr
- 在VS2010-VS2015下编译时,如何使用decltype作为较大类型表达式的LHS
- 调用专用模板时出错"no matching function for call to [...]"
- 图片不显示,关闭时出错 --> 调试断言失败!表达式:is_block_type_valid(标头>_block_use)
- 从 lambda 表达式返回布尔值时出错
- 在给定表达式的情况下返回对类型的引用时出错:“cond ?*这个 : 投掷()'
- 删除时出错:表达式必须是指向完整对象类型的指针
- 条件表达式解析新表达式中详细阐述的类型说明符时出错
- 分析C++中的表达式时出错
- 首次尝试使用C lambda表达式时会出错
- 使用带有提升/正则表达式的 Rcpp,在 eval(expr, envir, enclos) 中出错:找不到对象 'libboost_regex'
- 在自定义库中使用正则表达式时出错
- 制作文件时出错:令牌之前的预期主表达式')'
- 令牌之前'||'预期主表达式出错
- 具有未定义行为但从未实际执行的表达式是否会使程序出错
- 在c++中使用boost正则表达式匹配从字符串转换为整型时出错