Wednesday 2 October 2013

Need help for operators << and >>

Can anybody explain--please..

Usually overloading operators << and >> should return ostream by reference. But in our project why does it return console by reference??

1 comment:

  1. For this program we basically wrote our own "cout" and "cin" that does what we want it to do. It needs a Console object on the left of the operator and it returns a console object so that you can cascade.

    #include"console.h"

    int main()
    {
    cio::Console cout;
    cio::Console cin;

    int test;

    cin >> test;
    cout << test;
    }

    ReplyDelete