错误:与"运算符<<"不匹配(操作数类型为"std::basic_ostream<char>"
error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’
我的代码有问题。
void viewall(struct student st[], int itemcount)
{
int i = 0;
cout << left << setw(5) << "ID" << setw(20) << "NAME" << setw(5) << "SEX"
<< setw(5) << "Q1" << setw(5) << "Q2" << setw(5) << "AS" << setw(5)
<< "MI" << setw(5) << "FI" << setw(5) << "TOTAL" << "n";
cout
<< "========================================================================n";
while (i <= itemcount)
{
if (st[i].stnumber != "")
{
cout << left << setw(5) << st[i].stnumber << setw(20)
<< st[i].stname << setw(5) << st[i].sex << setw(5)
<< st[i].quiz1 << setw(5) << st[i]quiz2 << setw(5)
<< st[i].assignment << setw(5) << st[i].midterm
<< setw(5) << st[i].finale << setw(5) << st[i].total
<< "n";
}
i = i + 1;
}
}
error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’
<----这就是我犯的错误,我该怎么办?
看起来你有一个拼写错误:
[…]<lt;st[i]quiz2<lt;[…]
更有可能是:
[…]<lt;st[i].quiz2<lt;[…]
注意.
(点)
相关文章:
- 请解释这句话(cout<<1+int((a<b)^((b-a)&1) )<<endl
- 呼叫运营商<<临时
- 如何防止clang格式在流运算符调用之间添加换行符<<
- <<操作员在下面的行中工作
- 如何在Visual Basic中使用矩形函数OpenGL绘制矩形
- 这是 basic.def.odr 部分的缺陷吗?
- 未定义的对象(〔basic.life〕/8):为什么允许引用重新绑定(和常量修改)
- 如何显式调用运算符<<
- C++标准在[basic.scope.hiding]中"same scope"到底意味着什么?
- 为什么我们需要 [basic.scope.class]/2?
- 模板操作员&lt;未打电话
- C / CUDA中的模板方法是3个角括号(&lt;&lt;&lt;)
- C - 创建矢量&lt; vector&lt; double&gt;&gt;矩阵具有分配而不是inizializ
- 错误:调用"std::vector<:vector<int>>::p ush_back(std::vector<std::__cxx11::basic_string<
- [basic.lookup]/1 中最后一句话是什么意思?
- C 建造者Clang STD :: Sill,找不到超载的操作员&lt;
- 字符串C :libc abi.dylib:终止未被发现的类型std :: out_of_range:basic
- 为什么STD :: MAP需要操作员&lt;以及我如何写一个
- TagniFi的HTTPS Basic Authentication 在 Qt 中失败
- 为什么“操作员”需要const但不是为“运营商&lt;”