繁体   English   中英

'<'令牌错误之前的预期主表达式

[英]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-23\n";
   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){

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM