fstream을 사용 중이며 오류가 발생했습니다.iostream에서 C++ 컴파일 오류가 발생했습니다.
class CLog
{
void printOn(std::ostream& dbg) const;
}
void operator>>(const CLog& s, std::ofstream& dbg)
{
s.printOn(dbg);
}
하지만 컴파일 할 때 다음과 같은 오류 있어요 : : ofstream이 불가능 왜 ostream에에서 상속
error C2664: 'printOn' : cannot convert parameter 1 from
'class std::basic_ofstream<char,struct std::char_traits<char> >' to
'class std::basic_ostream<char,struct std::char_traits<char> > &'
A reference that is not to 'const' cannot be bound to a non-lvalue
생각을 여기에
내가 가진 무엇인가? 출력 연산자의
Arggg! 누락 된'#include'을 발견했습니다. 컴파일러의 어리석은 결과물. 모두 고마워요 –
mathk