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 08:19
Read: times


 
#152150 - Oh yes it does!
Responding to: ???'s previous message
Scott P. Dolan said:
I am wanna (sic) convert a long into string or char *.

You can't really convert it into just a "char *" - a pointer has to have something to point to!

I have the keil compiler but unfortunately the standard library's sprintf doesn't support long to char * conversion.

As Neil has already said, Oh yes it does!

See: http://www.keil.com/support/m...printf.htm which refers you to http://www.keil.com/support/m...printf.htm for details of the format strings - see the first Note immediately below the table of 'type' characters:

Note
  • The optional characters l or L may immediately precede the type character to respectively specify long types for d, i, u, o, x, and X.






  • 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