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

Unformatted I/O Revisited

Whereas formatted I/O deals with the translation of variables into text fields and vice versa, unformatted I/O can handle single or multiple characters. Recall that you saw the functions getchar, putchar, gets, and puts to process character data on stdin and stdout.

It is no surprise to learn that there are file equivalents to these that work in exactly the same way, except that the character data is output to and input from a file stream. This approach does have some uses, but it is not as flexible as other methods since it can cope only with character data.

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