Efficient Screen Output

This section looks at the different basic techniques that can be used for performing screen output.

The different techniques are discussed in separate sections and the Test Results subsection later in this section does an execution speed comparison of the techniques.

Using printf()

The printf() function can be used to write a string to the standard output stream (stdout). The string that is passed to printf() can contain complex formatting information that makes printf() a handy tool for doing conversions from binary variable values to strings. printf(), in fact, allows you to combine strings with automatically converted variables into a single output string. printf() was already part of C, but can still be used in C++. ...

Get C++ Footprint and Performance Optimization 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.