[TUHS] pic anomalies

Clem Cole clemc at ccc.com
Wed Jan 1 02:40:14 AEST 2020


On Mon, Dec 30, 2019 at 11:24 PM Doug McIlroy <doug at cs.dartmouth.edu> wrote:

> The use of %% to designate a literal % in printf is not
> a recent convention. It was defined in K&R, first edition.
>
FWIW, I still have an old (fading) copy of the galley proofs for the first
edition.  Page 147 (*Chapter 7 - Input and Output, Section 7.3 Formatted
Output - Printf*) first full paragraph on the page:

If the character after the % is not a conversion character, that character
is printed: thus % may be printed by %%.



>
> Doug
>
> Ralph Cordery wrote:
>
> Though that may seem odd to our modern C-standardised eyes, it's
> understandable in that if it isn't a valid %f, etc., format specifier
> then it's a literal percent sign.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20191231/3af55a4d/attachment.html>


More information about the TUHS mailing list