TAILIEUCHUNG - Lecture Practical C++ programming - Chapter 18: Operator overloading

One of C++’s great features is its extensibility. As we’ve seen in the section on classes, you can define objects and have them manage their own data structures. Now we learn how to define how the various C++ operators that work on these data structures. For this chapter we present a fixed point class. This class was chosen because it's simple and it demonstrates all of the simple operator overloading functions. | Chapter - 18 Operator Overloading Practical C Programming Copyright 2003 O Reilly and Associates Page 1 Fixed Point Numbers In floating point the decimal point can appear anywhere. In fixed point the number of digits after the decimal point is a fixed number for example 2 Practical C Programming Copyright 2003 O Reilly and Associates Page 2 namespace fixed_pt Basic Fixed Point Number Class const int fixed_exp 100 10 fixed_point class fixed_pt private Value of our fixed point number long int value . Numbers are stored as integers value number Practical C Programming fixedppoin t_exp . Page

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.