Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Overloading the
In this article
Input streams use the extraction (>>
) operator for the standard types. You can write similar extraction operators for your own types; your success depends on using white space precisely.
Here is an example of an extraction operator for the Date
class presented earlier:
istream& operator>> (istream& is, Date& dt)
{
is>> dt.mo>> dt.da>> dt.yr;
return is;
}