Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Tài liệu HOT
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
0
Trang chủ
Tài Liệu Phổ Thông
Sáng kiến kinh nghiệm
Object Oriented Programming (20)
TAILIEUCHUNG - Object Oriented Programming (20)
CSC241: Object Oriented Programming. Lecture No 22. 1 Previous Lecture.•. Friend function. – example program: Distance class. – Friend function for functional notation.•. Friend classes.•. static functions.•. Assignment operator and copy initialization. 2 Today’s Lecture.•. Example program. – Copy initialization. – Assignment operator overloaded.•. Memory efficient string class.•. Dynamic Type Information. 3 The Copy Constructor.•. Distance d2 = d1;. d2 d1. feet 7 feet 7. inche inche. . s s•. It is similar to what assignment operator (d2 =. d1) does.•. The difference is that copy initialization also. creates a new object 4 Example program – assignment alpha { copy constructor. void display(). private: { cout << data; }. int data; void operator = (alpha&. public: a) {. alpha() { } data = ;. alpha(int d) cout << “\nAssignment. { data = d; } operator invoked”;. alpha(alpha& a) { }. data = ; };. cout << “\nCopy a2 = a1;. alpha a3(a1);. constructor. invoked”; Program Output. } Assignment operator. invoked. Copy constructor invoked. 5 When Copy constructor is invoked1. Copy constructor may be invoked when an. object is defined. . alpha a3 = a2; or alpha a3(a2);.2. when arguments are passed by value to. functions void func(alpha a) { . . . }Alpha a =. called by the statement a1;. func(a1);.5. when values are returned from functions. 6 Why Not alpha(alpha a) Constructor?.•. Do we need to use a reference in the argument. to the copy constructor? alpha(alpha &a).•. Could we pass by value instead? alpha(alpha a). No, the compiler complains that it is out of. memory if we try to compile.•. Why?. •. Because when an argument is passed by. value, a copy of it is constructed What makes. the copy?. •. The copy constructor. But this is the copy 7 A Memory-Efficient String Class.•. Defects with the String Class S1. This is a long. – String object contains an array of char string in. memory. – s2 = s1;. S2. – problem with this is that the same string This is a long. now exists in two (or more) places in string in. memory. memory.•. An efficient approach S1 S2. • String object contain its own char*. • s2 = s1; This is a long. string in. • This is efficient, since only a single copy memory. of the string itself needs to be stored in 8 Problem with efficient approach.•. If we use this system we need to be careful. when we destroy a String object.•. Consider a situation in which several objects are. point to same string. S1 S2 S3.•. If one string objec
Tuệ Lâm
82
17
pptx
Báo lỗi
Trùng lắp nội dung
Văn hóa đồi trụy
Phản động
Bản quyền
File lỗi
Khác
Upload
Tải xuống
đang nạp các trang xem trước
Bấm vào đây để xem trước nội dung
Tải xuống
TÀI LIỆU LIÊN QUAN
Object Oriented Programming - Lesson 4: Object Initialization and Usage
36
93
0
Lecture Object oriented programming - Lecture No 04
33
76
1
Lecture Object oriented programming - Lecture No 05
20
72
1
Lecture Object-Oriented programming - Lesson 1: Object-Orientation (OO)
18
50
1
Lesson Object
1
75
0
Bài giảng Photoshop: Bài 7 - Làm việc với Smart Object sử dụng Filter
35
102
4
Chapter 4: Object-Oriented Data Modeling
45
85
0
Lecture An introduction to object-oriented programming with Java: Chapter 7 - C. Thomas Wu
46
76
0
Lecture An introduction to object-oriented programming with Java: Chapter 12 - C. Thomas Wu
37
73
0
Lecture An introduction to object-oriented programming with Java: Chapter 13 - C. Thomas Wu
45
88
0
TÀI LIỆU XEM NHIỀU
Một Case Về Hematology (1)
8
461865
55
Giới thiệu :Lập trình mã nguồn mở
14
22639
59
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10884
529
Câu hỏi và đáp án bài tập tình huống Quản trị học
14
10065
446
Phân tích và làm rõ ý kiến sau: “Bài thơ Tự tình II vừa nói lên bi kịch duyên phận vừa cho thấy khát vọng sống, khát vọng hạnh phúc của Hồ Xuân Hương”
3
9519
104
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8281
1125
Tiểu luận: Nội dung tư tưởng Hồ Chí Minh về đạo đức
16
8238
423
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7864
2220
Đề tài: Dự án kinh doanh thời trang quần áo nữ
17
6686
253
Vật lý hạt cơ bản (1)
29
5770
85
TỪ KHÓA LIÊN QUAN
Sáng kiến kinh nghiệm
Object Oriented Programming
Object Initializatio
Usage Acquaint
Data initialization
Object usage
Object declaration
Programming languages
Lecture Object oriented programming
Lập trình hướng đối tượng
Object oriented programming with Java
Object oriented programming in C++
Software object
Bài giảng Lập trình hướng đối tượng
Architectural models
Mechanical models
Tangible object
Lesson Object
Unified inheritance hierarchy
Access through Object reference
Unique Type object
Simple type string conversion
Automatic use of ToString
Bài giảng Photoshop
Làm việc với Smart Object
Cách sử dụng Filter
Cách mở tấm hình dưới dạng Smart Object
Chỉnh sửa đối tượng Smart Object
Làm việc với các filter
Object Oriented Data Modeling
Data Modeling
UML Language
Object Oriented Modeling
Object Modeling Example
Tranform Class Diagram to Relational Database Schema
Programming language
Java programming language
Sample object returning method
Overloaded methods
JFileChooser object
Primitive data types
String Tokenizer object
Abstract classes
Java program
Object serialization
Data hierarchy
Sequential access text files
Object oriented software engineering
Software engineering
Practical software development
Object orientation
Modeling with classes
Object diagrams
Inheritance hierarchies
Variable declarations
Object detection
Recognition in digital images
Object detection and tracking
Object recognition
Template based recognition
Object Oriented Programing
Lecture Object Oriented Programing
Direct superclass
Indirect superclass
Effect polymorphism
Demonstrating polymorphic behavior
Class file
Instance data values
Class data value
Software development
C++ programming
TÀI LIỆU MỚI ĐĂNG
Bibliography on Medieval Women, Gender, and Medicine 1980-2009
82
209
0
27-04-2024
Trading Strategies Profit Making Techniques For Stock_3
23
184
0
27-04-2024
Trading Strategies Profit Making Techniques For Stock_8
23
175
0
27-04-2024
Anh văn bằng C-124
8
175
0
27-04-2024
Magnetic Bearings Theory and Applications phần 2
14
172
0
27-04-2024
báo cáo hóa học:" Endoscopic decompression for intraforaminal and extraforaminal nerve root compression"
7
107
0
27-04-2024
Hệ thống làm lạnh và điều hòa không khí
21
125
0
27-04-2024
Christmas Meditations on the Twelve Holy Days
173
103
0
27-04-2024
Fecal Incontinence Diagnosis and Treatment - part 8
35
102
0
27-04-2024
báo cáo hóa học:" Increased androgen receptor expression in serous carcinoma of the ovary is associated with an improved survival"
6
99
0
27-04-2024
TÀI LIỆU HOT
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7864
2220
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
5727
1368
Ebook Chào con ba mẹ đã sẵn sàng
112
3767
1231
Ebook Tuyển tập đề bài và bài văn nghị luận xã hội: Phần 1
62
5319
1136
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8281
1125
Giáo trình Văn hóa kinh doanh - PGS.TS. Dương Thị Liễu
561
3498
643
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10884
529
Giáo trình Sinh lí học trẻ em: Phần 1 - TS Lê Thanh Vân
122
3684
525
Giáo trình Pháp luật đại cương: Phần 1 - NXB ĐH Sư Phạm
274
4046
515
Bài tập nhóm quản lý dự án: Dự án xây dựng quán cafe
35
4127
480
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.