Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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!


List of 33 messages in thread
TopicAuthorDate
GSM Module Testing            01/01/70 00:00      
   9-wire VS 3-wire            01/01/70 00:00      
   Don't guess!            01/01/70 00:00      
   I will            01/01/70 00:00      
      missed the point            01/01/70 00:00      
      probably the commonest beginner's mistake with AT commands            01/01/70 00:00      
         ohhhkie            01/01/70 00:00      
   it is working, BUT !            01/01/70 00:00      
      Look at string manipulation on other targets - almost same            01/01/70 00:00      
         which other targets,            01/01/70 00:00      
            RE: printf            01/01/70 00:00      
               sorry            01/01/70 00:00      
                  Do you need generic formatting?            01/01/70 00:00      
                     HANG            01/01/70 00:00      
                        RTFM            01/01/70 00:00      
                     puts, itoa            01/01/70 00:00      
                        itoa() isn't generally available            01/01/70 00:00      
                           None of which            01/01/70 00:00      
                     If you do need generic formatting...            01/01/70 00:00      
                  Any 'C' textbook...            01/01/70 00:00      
   how to read a reply ??            01/01/70 00:00      
      CRLF - and V.250            01/01/70 00:00      
      carriage return and line feed            01/01/70 00:00      
      CR n LF            01/01/70 00:00      
         A State Machine...            01/01/70 00:00      
            Dear Andy            01/01/70 00:00      
               google academy            01/01/70 00:00      
               Oh, come on!            01/01/70 00:00      
                  State Machines are easy...            01/01/70 00:00      
                     IAR Article on State MachineDesign            01/01/70 00:00      
               Thanks            01/01/70 00:00      
                  Another keyword you might try...            01/01/70 00:00      
   It is working !!            01/01/70 00:00      

Back to Subject List