??? 04/08/10 13:02 Read: times |
#174920 - If you do need generic formatting... Responding to: ???'s previous message |
Per Westermark said:
it's quite easy to write a small function that converts the value of an int into a string of digits. However, if you do need a lot of different formatting, at some point it becomes more effective to use printf! When you've used printf once, there is little or no further overhead to use it hundreds of times; but, if you write another little function each time you need a slightly different format, you could end up worse off! I think I've mentioned before that I once worked on a project which had a function to print an int from XDATA in decimal, a function to print an int from CODE in decimal, a function to print an int from XDATA in hex, a function to print an int from CODE in hex, and so on, and so on... In the end, I'm not convinced that they were better off than just using printf! |