1. Trang chủ
  2. » Công Nghệ Thông Tin

Lecture Object oriented programming - Lecture No 05

20 22 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 20
Dung lượng 123,54 KB

Nội dung

In the previous chapter, we looked at UML class diagrams. This chapter continues the study of the static view of software by looking at typical patterns found in class diagrams. These patterns recur in many designs; by learning and using them you are reusing the collective experience of many software developers.

CSC241: Object Oriented Programming Lecture No 05 Previous Lecture • Overloaded function – • Constructor const (constant) – object – member function – data member – object as function argument • friend function • this pointer Today’s Lecture • Reference variable • this pointer – Cascading function calls • Dynamic memory allocation • static class member • – static functions – static data member sdaf C++ Reference variable • • • C++ references allow you to create a second name for a memory location that you can use to read or modify the original data stored in that location Syntax – int& foo = ; – reference to an int When a reference is created, you must tell it which variable it will become an alias for Cont – int x; – int& y = x; – y = 50; – cout

Ngày đăng: 20/09/2020, 13:23