TAILIEUCHUNG - A Complete Guide to Programming in C++ part 61

A Complete Guide to Programming in C++ part 61. This book provides both novice and experienced programmers with a comprehensive resource manual for the C++ programming language. Readers gain experience in all aspects of programming, from elementary language concepts to professional software development, with in depth coverage of all the language elements en route. These elements are carefully ordered to help the reader create useful programs every step of the way. | EXERCISE 579 Exercise Modify and complete the definition of the class InhomList which represents an inhomogeneous list. Write the destructor for the InhomList destructor releases the memory occupied by the remaining list elements. Implement the getPrev method and both versions of the insert and insertAfter algorithm needed for inserting list elements was described in the section Implementing an Inhomogeneous List. Implement the displayAll method which walks through the list sequentially outputting each element. Test insertion and output of list elements. Check whether the comments on the objects are output if present. Define the getPos method which locates the position of an element to be deleted. If the element is in the list its address is returned. Otherwise a NULL pointer is returned. Write the erasePos method which deletes a list element at a given position. Pay attention to whether the element to be deleted is the first or any other element in the list. Since the destructor for Cell was declared virtual only one version of the deletePos method is necessary. Define the erase method which deletes a list element with a given name from the list. Test deletion of list elements. Continually display the remaining elements in the list to be certain. Now implement the copy constructor and assignment. Use the insert to construct the list calling the applicable version of the can call the typeid operator to ascertain the type of the list element currently to be operator is declared in the header file typeinfo. Example if typeid ptr typeid DerivedEl . The expression is true if ptr references a DerivedEl type object. Then test the copy constructor and the assignment 580 CHAPTER 26 ABSTRACT CLASSES SOLUTION --------------------------------------------------------- Defines the classes Cell BaseEl and DerivedEl. --------------------------------------------------------- ifndef _CELL_ define _CELL_ include string include .

TỪ KHÓA LIÊN QUAN
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.