Skip to Main Content
Professional C++, 6th Edition
book

Professional C++, 6th Edition

by Marc Gregoire
February 2024
Intermediate to advanced content levelIntermediate to advanced
1376 pages
40h 6m
English
Wiley
Content preview from Professional C++, 6th Edition

13Demystifying C++ I/O

A program's fundamental job is to accept input and produce output. A program that produces no output of any sort would not be very useful. All languages provide some mechanism for I/O, either as a built-in part of the language or through an OS-specific API. A good I/O system is both flexible and easy to use. Flexible I/O systems support input and output through a variety of devices, such as files and the user console. Files could be standard files but could also be data coming from a variety of sources such as Internet of Things (IoT) devices, web services, and more. It could be weather data from a weather device or stock values from a stockbroker web service. Flexible I/O systems also support reading and writing of different types of data. I/O is error-prone because data coming from a user can be incorrect or the underlying filesystem or other data source can be inaccessible. Thus, a good I/O system is also capable of handling error conditions.

If you are familiar with the C language, you have undoubtedly used printf ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming: Principles and Practice Using C++, 3rd Edition

Programming: Principles and Practice Using C++, 3rd Edition

Bjarne Stroustrup
C++ Primer, Fifth Edition

C++ Primer, Fifth Edition

Stanley B. Lippman, Josée Lajoie, Barbara E. Moo

Publisher Resources

ISBN: 9781394193172