8 INPUT/OUTPUT

This chapter will teach you how to perform input/output (I/O) operations to read data from, or write data to, terminals and filesystems. Information can enter a program via command line arguments or the environment and exit it via its return status. However, most information typically enters or exits a program through I/O operations. We’ll cover techniques that use C standard streams and POSIX file descriptors. We’ll start by discussing C standard text and binary streams. We’ll then cover different ways of opening and closing files using C standard library and POSIX functions.

Next, we’ll discuss reading and writing characters ...

Get Effective C, 2nd Edition 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.