0
How can I override the "<<"-operator in C++?
Want to override the "<<", so that I can use it with my own class types/objects
2 Réponses
+ 5
ostream & operator <<(ostream & o, const yourclass& obj)
{
o << obj.data;
return o;
}
where obj.data is what you want to display.
0
Tank you