dr. salih yurttas - yurttas@cs.tamu.edu
programming languages - design principles, implementation constructs
c++

  1. abstraction mechanisms: classes and operator overloading
    1. class/object construction - operator overloading
      1. V - [ vector class with OCCF and operator overloading ]
      2. default values for default constructor
        and operator[], operator+ is overloaded

        [] can be used both in lhs and rhs.

        + is implemented as a friend function so that it is with two parameters. lhs is non-mutable.
        [you shouldn't attempt to return a reference of a local object.]
        return type is reference and local object reference is not acceptable.

        V.cpp and v_00.cpp will compile with a warning will core dump during the run time whenever + function is referenced.


1 | basic facilities << 3 >> class derivation | 5 | 6 | 7 | 8
computer science | texas a&m university

Valid XHTML 1.0 Transitional