Basic facilities
- slide 36 : 46
Overloaded operators and IO
Existing operators must be choosen for IO purposes
The
assignment
operator was considered
cin = x
and
cout = y
Its association to the right is inappropriate
The
less than
and
greater than
operators were considered
cin > x
and
cout < y
Unreadable, and confusing
The
left shift
and
right shift
operators were choosen
cin >> x
and
cout << y
The relative low priority of
<<
is practical when values of expressions must be printed.
cout << x + y * z
and not
cout << (x + y * z)
The C++ Progr. Lang. (3. edition)
: Page 121-122: operator priorities