WillFerrellLuva
March 29th, 2010, 02:52 PM
Someone please tell me where I am going wrong here. I want to overload the binary operator << so I can output with my class. I declared the the overload in a header file:
friend std::ostream& operator<<(std::ostream& out, const big_int& show);
and defined the overload in an implementation file:
ostream& big_int::operator<<(ostream& out, const big_int& show)
...
But when I try to compile I get the following error:
chris@chris-desktop:~/Code/Projects/Challenge 10$ make
g++ -c -Wall big_int.cpp -o big_int.o
big_int.cpp:84: error: ‘std::ostream& big_int::operator<<(std::ostream&, const big_int&)’ must take exactly one argument
Any help would be greatly appreciated.
friend std::ostream& operator<<(std::ostream& out, const big_int& show);
and defined the overload in an implementation file:
ostream& big_int::operator<<(ostream& out, const big_int& show)
...
But when I try to compile I get the following error:
chris@chris-desktop:~/Code/Projects/Challenge 10$ make
g++ -c -Wall big_int.cpp -o big_int.o
big_int.cpp:84: error: ‘std::ostream& big_int::operator<<(std::ostream&, const big_int&)’ must take exactly one argument
Any help would be greatly appreciated.