어떤 부분에서 오류가 발생했는지 모르겠습니다.

조회수 361회

include

using namespace std;

class Adder { int total; public: explicit Adder (int n = 0):total(n) { } int operator() (int n) { return total+=n; } };

int main() { Adder add(0); cout << "hello" << endl; cout << add(20) << endl; cout << add(30) << endl;

return 0;

} no match for 'operator<<' (operand types are 'std::basic_ostream' and '') 해당 오류가 발생하는데 'cout << "hello" << endl; ' 해당 부분은 문제가 없지만 아래 cout << add(20) << endl; cout << add(30) << endl; 부분에서 위의 오류가 뜹니다 해결방법을 아시는분 계신가요?

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)