ostream& operator <<(ostream& osObject, const storageRentals& rentals)
{
osObject << rentals.summaryReport();
return osObject;
}
summaryReport()
는 공극 함수이며, 저 오류 제공된다오버로딩 << 연산자 :: ostream에
no operator "<<" matches these operands
을했으나 오류가 I는 상기 summaryReport
기능을 변경하는 경우가없는 int
,하지만 그 문제는 값을 반환해야하며 화면에 출력하는 것입니다.
void storageRentals::summaryReport() const
{
for (int count = 0; count < 8; count++)
cout << "Unit: " << count + 1 << " " << stoUnits[count] << endl;
}
void 함수를 사용하여 cout <<
을 오버로드하는 방법이 있습니까?