令牌错误之前的预期主表达式'<'
expected primary-expression before '<' token error
嗨,我将回到C编程练习中,在这个特定的程序中,我在'<'之前得到了一个预期的主表达式第8行的令牌(While循环)。非常感谢对我需要修复的内容及其背后的原因进行澄清。这是代码,非常感谢!
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int number, i=8;
cout <<"Please enter all numbers from 8-23n";
cout <<"Start Now: ";
while (i=<23){
cin>>number;
cout<<"Next: ";
if (number!=i){
cout<<"That was the wrong, Please enter: "<<i<<endl;
}
else
i++;
}
cout<<"Congratulations!!n";
return 0;
}
while (i=<23){ ^^
请改用while (i <= 23)
。
while (i=<23){
应为while(i<=23){
相关文章:
- (C++)分析树以计算返回错误值的简单算术表达式
- 在VS2010-VS2015下编译时,如何使用decltype作为较大类型表达式的LHS
- 请解释这句话(cout<<1+int((a<b)^((b-a)&1) )<<endl
- 提升精神:解析布尔表达式并简化为规范范式
- 不能在初始值设定项列表中将非常量表达式从类型 'int' 缩小到'unsigned long long'
- 呼叫运营商<<临时
- 使用正则表达式regex_search在字符串中查找字符串
- 如何确认我的constexpr表达式实际上已经在编译时执行
- 概念中的cv限定符需要表达式参数列表
- 为什么constexpr的性能比正常表达式差
- 对于结构,表达式必须是可修改的ivalue
- 如何防止clang格式在流运算符调用之间添加换行符<<
- 当一个值是非常量但用常量表达式初始化时使用constexpr
- 将fold表达式与std::一起用于两个元组
- <<操作员在下面的行中工作
- 断言中的Fold表达式在某些计算机上编译,但在其他计算机上不编译
- 标记 '","' 之前的预期主表达式
- gcc和clang在表达式是否为常量求值的问题上存在分歧
- 如何计算具有指定类型的表达式的相对精度和绝对精度
- 1<<31产生误差;'<<'表达式未定义”;