6 Reading, writing, and formatting your data
This chapter covers
- Reading from the keyboard and writing to the screen
- Standard input, output, and error streams
- Formatting numbers and text
- Writing data to files on disk
One of the pillars of every useful program is its input and output (I/O). Almost every program reads some input data from the keyboard, file, or network; does some calculation or processing on it; and outputs the result to the screen, a file on disk, or some other device. If the program is designed to be used directly by a human user (rather than being a piece of some intricate pipeline), I/O becomes even more important. Specifically, inputting data to the program should be as easy as possible, with minimum effort for the user. ...
Get Modern Fortran now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.