Overload the << Operator for an ostream

  1. Define a friend function operator<<() for the CRational class, and another friend function operator<<() for the CMatrix class.
  2. Define a friend function operator>>() for the CRational class, and another friend function operator>>() for the CMatrix class.
  3. Now the previous main program
    
        cin >> n;
        CMatrix a(n,n), b(n,n), c(n,n);
        a.Read();
        b.Read();
        c = a + b;
        c.Print();
    
    
    can be simplified as
    
        cin >> n;
        CMatrix a(n,n), b(n,n), c(n,n);
        cin >> a >> b;
        c = a + b;
        cout << c;