TAILIEUCHUNG - Lecture Object oriented programming - Lecture no 27

The topics discussed in this chapter are: Object creation - a detailed analysis, assigning a reference, testing objects for equality, passing references as arguments, method-call chaining, overloaded methods, constructors, overloaded constructors. | CSC241: Object Oriented Programming Lecture No 27 Previous Lecture Functional templates Example program multiple arguments Macros vs. template Class templates Stack template class Default and non type parameter for class template Explicit specialization Today’s Lecture Exception Exception handling try , catch and throw block Multiple exceptions Exceptions Exceptions are errors that occur at runtime Exception handling provide a systematic, object-oriented approach to handling errors generated by C++ classes For example, running out of memory, not being able to open a file, trying to initialize an object to an impossible value, or using an out-of-bounds index Why Do We Need Exception handling C-language programs signal an error by returning a value from the function For example, disk-file functions often return NULL or 0 to signal an error if( somefunc() == ERROR_RETURN_VALUE ) //handle the error else //proceed normally if( anotherfunc() == NULL ) //handle the error else //proceed .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.