Let's go back to the K&R roots:
Origin
In the tutorial chapter, on page 11 of original K&R, you'll find a hint on the origin of the function:
By the way, printf
is not part of the C language; there is no input
or output defined in C itself. There is nothing magic about printf
;
it's just a useful function that is part of the standard library of
routines that are normally accessible to C programs.
The wording "accessible" suggests that it could be based on libraries shared with other programming languages as suggested by Jules, or on shared OS libraries. As B and C both are closely linked to the development of UNIX, and the same people, D.Ritchie, B.W.Kernighan and K.Thompson closely worked together on these matters, it is not surprising that they use similar naming conventions.
Why the f of printf ?
The title of section 7.3 Formatted output - printf on page 145 of original K&R strongly suggest that the f
stands for formatted:
Searching in other sources will show that B's and C's printf
both seem to originate from BCPL's writef
function which used already in 1966 the %
formatting character.
Also worth to note that Algol68 also adopted printf
function for formatted output. Yet the formatting logic was a little different.
printf
is C's most basic output function is false. In addition toputs
, there's alsoputchar
.creat()
function has no "e" on the end. :-)