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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/12/08 14:33
Read: times


 
#152173 - better code example
Responding to: ???'s previous message
char long2string( char *s, long value)
{
short remainder;
char count=0;
char buf[32];
char w,i;

do{
remainder = value % 10;
value = value - remainder;
value = value / 10;
buf[count++] = dec2ascii( remainder );
}while( 0 != value );

// Transverse the list
w=0;
for(i=count-1; i>=0; i--)
s[w++] = buf[i];
s[w++] = 0;
s[w++] = 0;

return count;
}


List of 12 messages in thread
TopicAuthorDate
converting a long to acsii char *            01/01/70 00:00      
   sprintf() works fine.            01/01/70 00:00      
      Maybe; maybe not            01/01/70 00:00      
      I am going to try %ul as a sprintf specifier            01/01/70 00:00      
   Oh yes it does!            01/01/70 00:00      
      Mod10, than divide works tooo            01/01/70 00:00      
   code example            01/01/70 00:00      
      superfluous line of code            01/01/70 00:00      
   better code example            01/01/70 00:00      
      still applies to 'better code'            01/01/70 00:00      
      How to post source code            01/01/70 00:00      
      Why 32 char buffer?            01/01/70 00:00      

Back to Subject List