新手小白求教大神查找for语言错误

、浅浅笑 2018-06-24 05:28:22

#include "stdafx.h"
#include <iostream>
using namespace std;
struct student_info
{
string strName;
int chinese;
int math;
int engilsh;
};
student_info student[50];
int main()
{
int i = 0;
char a[20];
for (i = 0; i < 50; i++)
{
cout << "Enter the " << i + 1 << " student's information : " << endl;
cout << "Enter name : ";
cin >> a;
student[i].strName = a;
cout<<"Enter Chinese performance : ";
cin >> student[i].chinese;
cout << "Enter Math performance : ";
cin >> student[i].math;
cout << "Enter English performance : ";
cin >> student[i].engilsh;
}
for (i = 0, i < 50, i++)
{
cout << "The " << i + 1 << " student's informance : " << endl;
cout << "Name : " << student[i].strName.c_str() << endl;
cout << "Chinese performance : " << student[i].chinese << endl;
cout << "Math performance : " << student[i].math << endl;
cout << "Engilsh performance : " << student[i].engilsh << endl;
}

第二个for循环,我的vs2017编译器不能通过?为什么?和第一个for没区别啊....
...全文
65 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
、浅浅笑 2018-06-24
  • 打赏
  • 举报
回复
瞎了瞎了,分数拿走。
vioy 2018-06-24
  • 打赏
  • 举报
回复
第一个 for (i = 0; i < 50; i++) 是分号

64,676

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧