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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/31/10 17:42
Read: times


 
#177552 - Don't fight too much which which alternative to use
Responding to: ???'s previous message
Note that that long will store a value, but not the numeric value of the input. So you may just as well use a short for the data.
It's easy to use division and modulo to extract a decimal digit from a specific position in a number. And if you already have printf() in your program, then sprintf() is a good way to create a printable string. Or you can use same div and mod operation to create the four digits and add '0' to make them printable ASCII characters.

But there are many, many ways to do this - just select any working solution. As long as the code is fast enough and fits in the processor, you have a working solution.

List of 10 messages in thread
TopicAuthorDate
User editable parameter            01/01/70 00:00      
   Don't fight too much which which alternative to use            01/01/70 00:00      
      Solved..            01/01/70 00:00      
         but you get a headache ...            01/01/70 00:00      
   Maybe a better way            01/01/70 00:00      
      Unpleasant with too large speedup steps            01/01/70 00:00      
      Fast scroll algorithm            01/01/70 00:00      
         I agree!            01/01/70 00:00      
   Use String            01/01/70 00:00      
      Exactly the way you said            01/01/70 00:00      

Back to Subject List