Is there any libruary function to convert ascii to binary

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjuks
    New Member
    • Dec 2007
    • 72

    Is there any libruary function to convert ascii to binary

    Hi,

    Does C provides any library function to convert from ascii value to binary? Or we need to write our own function for it.

    Thanks,
    Manjunath
  • Laharl
    Recognized Expert Contributor
    • Sep 2007
    • 849

    #2
    You'll need to write your own function for this as far as I know, as C can easily convert between decimal/octal/hexadecimal, but binary...there' s not even a printf tag for it.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      If you mean convert from a string of characters to an integer (or float) with the corresponding value then look up

      atoi
      atol
      atof
      strtol
      strtoul
      strtof

      in your C library reference

      Comment

      • manjuks
        New Member
        • Dec 2007
        • 72

        #4
        I wrote the function to convert from ascii to binary. Just i wanted to know weather is there any libruary function for that.
        Thanks for replies,

        Thanks,
        Manjunath

        Comment

        Working...