the overloading operators can have more than 2 parameters?
i'm thinking on 'operator >>' or 'operator <<', because it can be shift or using the ostream class...
can anyone explain more about it?
To answer the title question: No. The only ternary (as opposed to binary or unary) operator in C++ is the ?: operator ("conditional operator"), and that can't be overloaded in C++.
The >> and << operators are still binary operators. It's just that they return a reference to the left-hand-side stream, so you can chain the operations. Just like addition (3 + 2 + 1) is the same as ((3 + 2) + 1).
binary because the need 2 numbers(thinking on plus for example).... thank you so much for all.
the operator << can be binary or unary.... because can have 2 operators(the ostream(what call it) and the string(or the class name variable)).
now understand more about it. thank you so much for all
Yes, in that case you're defining it as friend though. So it's still binary, kinda like a static class function. Edit: bad analogy, it isn't static, see keskiverto's post.
ostream is just the base class of things like fstream and cout (cout is a global object). So it's printing those things to the output stream os, which could be a file, a stringstream, or standard out (cout). Does that answer your question?