3 ms·
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.
by cbd1984 12y ago
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.
- lelandbatey 12y agoWhat 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/ http://lelandbatey.com/posts/2014/09/binary-tree-printer/