TAILIEUCHUNG - Lecture Programming principles and practice using C++: Chapter 10 - Bjarne Stroustrup
We get data from files, sensors, web connections, etc., which we want to analyze, print, graph, etc. Sometimes, we want to produce such data. In this lecture, we look at C++’s basic mechanisms for reading and writing streams of data. We also discuss an interesting – apparently trivial – problem: how to read an integer. | Chapter 10 Input/Output Streams Bjarne Stroustrup Abstract We get data from files, sensors, web connections, etc., which we want to analyze, print, graph, etc. Sometimes, we want to produce such data. In this lecture, we look at C++’s basic mechanisms for reading and writing streams of data. We also discuss an interesting – apparently trivial – problem: how to read an integer. Stroustrup/Programming/2015 Overview Fundamental I/O concepts Files Opening Reading and writing streams I/O errors Reading a single integer Stroustrup/Programming/2015 Input and Output input device device driver input library our program output library device driver output device data source: data destination: Stroustrup/Programming/2015 The stream model An ostream turns values of various types into character sequences sends those characters somewhere ., console, file, main memory, another computer c (1,234) 123 ostream buffer “somewhere” .
đang nạp các trang xem trước