TAILIEUCHUNG - Chapter 12 Streams and File I/O

Streams connect to files with open operation, Member function fail() checks successes. Stream member functions format output, ., width, setf, precision. Same usage for cout (screen) or files | Chapter 12 Streams and File I/O Learning Objectives I/O Streams File I/O Character I/O Tools for Stream I/O File names as input Formatting output, flag settings Stream Hierarchies Preview of inheritance Random Access to Files Introduction Streams Special objects Deliver program input and output File I/O Uses inheritance Not covered until chapter 14 File I/O very useful, so covered here Streams A flow of characters Input stream Flow into program Can come from keyboard Can come from file Output stream Flow out of program Can go to screen Can go to file Streams Usage We’ve used streams already cin Input stream object connected to keyboard cout Output stream object connected to screen Can define other streams To or from files Used similarly as cin, cout Streams Usage Like cin, cout Consider: Given program defines stream inStream that comes from some file: int theNumber; inStream >> theNumber; Reads value from stream, assigned to theNumber Program defines stream outStream that goes to .

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.