인프런 커뮤니티 질문&답변
operator << 에 관한 질문입니다
작성
·
336
1
07:57 위치에 friend std::ostream& operator << (std::ostream& out, Cents& cents)
{
out << cents.m_cents;
return out;
}에서 두번째 입력값인 Cents& cents앞에 const를 빼고 compile하니 에러가 발생합니다.
꼭 const를 입력해야하는 이유가 무었인지 궁금합니다.





