Yurttas/PL/OOL/Cplusplus/F/03/02/00/04.html

Revision as of 22:05, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="divone"><span class="h4"> [http://wiki.zcubes.com/yurttas/ Dr.Salih Yurttas ] - [mailto:yurttas@zcubes.com yurttas@zcubes.com] </span></div><div class="divone"><...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
programming languages - design principles, implementation constructs
c++

  1. abstraction mechanisms: classes and operator overloading
    1. operator overloading
      1. basic rules - binary and unary operators - example class A { // members (with implicit first argument: this) : A* operator& (); // prefix unary & (address of) A operator& (A); // binary & (and) A operator++ (int); // postfix increment A operator& (A,A); // error: ternary A operator/ (); // error: unary / // global functions (often friends) : friend A operator- (A); // unary minus friend A operator- (A,A); // binary minus friend A operator-- (A&,int); // postfix decrement friend A operator- (); // error: no operand friend A operator- (A,A,A); // error: ternary friend A operator% (A); // error: unary % };

<< | >>


1 | basic facilities << 3 >> class derivation | 5 | 6 | 7 | 8