OpenSolaris
I've been looking at the OpenSolaris source code.
I found this little gem. It will print a number n in base b to stdout. That's fine but this one works recursively. Also note the use of register long.
The thing with the code is they only use it to print an octal, decimal or hexadecimal number. These are easily replaced with printf using %o %u and %x respectively.
I found this little gem. It will print a number n in base b to stdout. That's fine but this one works recursively. Also note the use of register long.
The thing with the code is they only use it to print an octal, decimal or hexadecimal number. These are easily replaced with printf using %o %u and %x respectively.
0 Comments:
Post a Comment
<< Home