Hi,
to output the private data of a class I want to overload the operator<<. The
Output should be written in a string-variable.
To do this i have written the attached code:
But the program-compilation aborts with the following error message:
StreamKoord.cpp: In function `int main()':
StreamKoord.cpp:44: error: no match for 'operator<<' in 'std::operator<<
[with _Traits = std::char_traits<char>]((&oss), "String: Scheitel=") <<
scheitel'
/usr/include/g++/bits/ostream.tcc:63: error: candidates are:
***std::basic_ostream<_CharT,*_Traits>&*std::basic _ostream<_CharT,
***_Traits>::operator<<(std::basic_ostream<_CharT,
***_Traits>&(*)(std::basic_ostream<_CharT,*_Traits >&))*[with*_CharT*=*char,
***_Traits*=*std::char_traits<char>]
*...
A lot of further candidates are listed. But my additional method wasn't
listed.
What is wrong in my code and how can i solve this problem?
Many thanks in advance,
Andreas
PS: gcc: 3.3.4 / linux 2.6.8-24.11-smp