m0_64509442 2022-05-14 02:53 采纳率: 83.3%
浏览 13
已结题

c加加小问题 代码 小错误了

#include
using namespace std;
struct student
{int num;
char name[20];
float score;
}
int main()
{student stud[3]={1001,"Li",78,1002,"Wang",89.5,1004,"Fang",90};
char c[50];
ostream strout(c,30);
for(int i=0;i<3;i++)
strout<<stud[i].num<<stud[i].name<<stud[i].score;
strout<<ends;
cout<<"array c:"<<c<<endl;
}

img

img

  • 写回答

1条回答 默认 最新

  • Ltd Pikashu CSDN实力新星 2022-05-14 03:46
    关注

    头文件包含了 #include <iostream> 了吗?头文件名不要出错哦

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

问题事件

  • 系统已结题 5月26日
  • 已采纳回答 5月19日
  • 创建了问题 5月14日