Re:Where the Printf Rubber Meets the Road (2010)
by cbd1984 on Saturday October 04, 2014 @08:20PM
(#8411031)
How is that function mysterious? It just writes the same character to stdout len times. The only mystery is how anyone thought that would be efficient.
[ Parent
| on HN ]
Re:Where the Printf Rubber Meets the Road (2010)
by lelandbatey on Saturday October 04, 2014 @09:33PM
(#8411172)
What I mean by mysterious is that the syscall is hidden in the write statement, vs hidden in the printf statement. Also, I wrote the above function (actually a much smaller version) as part of a program that would print a binary tree of any given height[0]. It wasn't meant to be efficient, it was meant to be small, since the total size of the program was 777 bytes (later reduced to 505 bytes).
[0] - http://lelandbatey.com/posts/2014/09/binary-tree-printer/