bài giảng chú giải trình hướng đối tượng bài 2

54 262 0
bài giảng chú giải trình hướng đối tượng bài 2

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

     ◦  ◦ void ◦  constructor  !"#  $#   ◦ !  ◦ %new# Destructor  It is # #   #'~'  #    !&#   %delete# '&# ( $ ( !)*# + CMSC 202, Version 3/02 , !# /.!  0.!) )#& 1.!2&3. -4-/0 #4 /41 23.#4 !#+ CMSC 202, Version 3/02 5  676)   *#&  !&#       #*#) !6) + CMSC 202, Version 3/02 - 8  ### )#) 94  ###  &)  9 #  [...]... (called binary form), + indicates integer addition, as in the expression 5+ 9  Between two floating-point numbers (also called binary form), + indicates floating-point addition, as in the expression 6.4 + 2. 1 Overloading Operators— The Rules  Operator overloading is the process by which     you apply operators to your own abstract data types The +, -, *, and / symbols make it easy to work with built-in . !# /.!  0.!) )#& 1.! 2& amp;3. -4-/0 #4 /41  2 3.#4 !#+ CMSC 20 2, Version 3/ 02 5  676)   *#&  !&#       #*#) !6) + CMSC. # #   #'~'  #    !&#   %delete# '&# ( $ ( !)*# + CMSC 20 2, Version 3/ 02 , !# /.!  0.!) )#& 1.! 2& amp;3. -4-/0 #4 /41  2 3.#4 !#+ CMSC. 3/ 02 5  676)   *#&  !&#       #*#) !6) + CMSC 20 2, Version 3/ 02 - 8  ### )#) 94  ###  &)  9 #  #  copy

Ngày đăng: 24/10/2014, 16:24

Mục lục

    When do we make copies of an object?

    What is a copy constructor?

    Why haven’t we seen this before?

    Virtual Functions (cont’d)

    Understanding the Benefits of Overloading

    Using the + Operator Polymorphically

    Overloading Operators— The Rules

    Binary Operators that Can Be Overloaded

    Overloaded Operator>>() Function for the Sale Class

    Using the Prefix and Postfix ++ Operators with an Integer

Tài liệu cùng người dùng

Tài liệu liên quan