操作员不匹配>>
No match for operator>>
它说这个函数有问题。它应该从用户那里获得要订购的线轴数量的输入,然后输出收到的输入。(考虑在有时间的情况下添加一个确认对话框(。
/********************************************/
// Name: inspools /
// Description: Ask for and get number of /
// spools /
// Parameters: N/A /
// Reture Value: spoolnum /
/********************************************/
int spoolnum()
{
int spoolnum;
cout << "Number of spools to be shipped: " << endl;
cin >> spoolnum;
cout >> spoolnum >> " spool(s) of wire will be shipped" >> endl;
return;
}
您的箭头在这行向后:
cout >> spoolnum >> " spool(s) of wire will be shipped" >> endl;
应该是:
cout << spoolnum << " spool(s) of wire will be shipped" << endl;
您的return
语句需要返回一些内容:
return spoolnum;
是。。您需要将<<
与cout
一起使用。
ostream
没有为>>
重载运算符,因此您看到了错误。
cout << spoolnum << " spool(s) of wire will be shipped" << endl;
并且您的return语句应该返回spoolnum:
return spoolnum;
此行:
cout >> spoolnum >> " spool(s) of wire will be shipped" >> endl;
应为:
cout << spoolnum << " spool(s) of wire will be shipped" << endl;
相关文章:
- Qt SQLite没有查询或参数计数不匹配
- 模板参数推导失败,函数参数/参数不匹配
- 在使用累加时,C++中的运算符+不匹配
- C++ 与操作员不匹配<<
- 在 Arduino 上使用 sscanf 会导致与 const char * 不匹配,并且返回值始终相同,尽管输入值不同
- 与'operator='不匹配(操作数类型'String'且"void")
- C++模板/别名 - 模板参数列表中参数 1 处的类型/值不匹配
- C4018:类内有符号、无符号不匹配
- 我在 .h 中有一个枚举类,并且在.cpp错误中有一个运算符重载:与"运算符<<不匹配
- 为什么我收到错误:"运算符<<不匹配?
- RE2 不匹配非 ASCII 字符
- 函数签名与调用的函数不匹配,常量字符[]和字符*之间的区别?
- 模板推导:为什么函数指针模板定义在常量和/或引用时不匹配?
- 错误:"模板<类_Tp,类_Dp>类 std::unique_ptr"的模板参数列表中参数 1 的类型/值不匹配
- OpenSSL fips in C++ wrapper Library 如何?错误:指纹不匹配
- 为什么我的数组值与此处的全局变量不匹配?
- 引号之间匹配/不匹配,带有不可避免的引号和多行
- 映射迭代器与运算符不匹配
- C++调用和定义不匹配
- 模板专用化与派生类不匹配