August 2004
Intermediate to advanced
352 pages
7h 38m
English
sprintfDifficulty: 3
In this Item and the next, an Orwellian look at the mysteries of sprintf and why the alternatives are always (yes, always) better.
“All animals are equal, but some animals are more equal than others.” | ||
| --George Orwell, Animal Farm | ||
What is sprintf? Name as many standard alternatives to sprintf as you can.
Consider the following C code that uses sprintf to convert an integer value to a human-readable string representation, perhaps for output on a report or in a GUI window:
// Example 2-1: Stringizing ...