O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recap

In this chapter, you saw two kinds of file (stream-based) input and output. The formatted variants mirror the stream-oriented terminal reading and writing capabilities provided in the stdio.h library. This is useful for textual data and for instances where the format is well known and should be shared across applications (HTML or CSV files, for example).

Binary input and output have other advantages. They are easier to manipulate programmatically. However, they come with the added disadvantage that the binary files are harder to debug. They can, however, be more data efficient and provide a better closed binary system than text files.

Generally speaking, it’s best to use formatted text for shared plain text data and binary formatting for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required