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

A Complete Guide to Programming in C++ part 9. 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. | STREAMS 59 I O Stream Classes During the development of C a new class-based input output system was implemented. This gave rise to the I O stream classes which are now available in a library of their own the so-called iostream library. The diagram on the opposite page shows how a so-called class hierarchy develops due to inheritance. The class ios is the base class of all other stream classes. It contains the attributes and abilities common to all streams. Effectively the ios class manages the connection to the physical data stream that writes your program s data to a file or outputs the data on screen contains the basic functions needed for formatting data. A number of flags that determine how character input is interpreted have been defined for this purpose. The istream and ostream classes derived from ios form a user-friendly interface for stream manipulation. The istream class is used for reading streams and the ostream class is used for writing to streams. The operator is defined in istream and is defined in ostream for example. The iostream class is derived by multiple inheritance from istream and ostream and thus offers the functionality of both classes. Further stream classes a file management class for example are derived from the classes mentioned above. This allows the developer to use the techniques described for file manipulation. These classes which also contain methods for opening and closing files will be discussed in a later chapter. Standard Streams The streams cin and cout which were mentioned earlier are instances of the istream or ostream classes. When a program is launched these objects are automatically created to read standard input or write to standard output. Standard input is normally the keyboard and standard output the screen. However standard input and output can be redirected to files. In this case data is not read from the keyboard but from a file or data is not displayed on screen but written to a file. The other two standard .

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.