how to convert entered ascii value to float

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arunak11
    New Member
    • Sep 2012
    • 1

    how to convert entered ascii value to float

    Hi

    any one help me in converting ascii value entered by user.

    How to convert it to float basic of c programming techniques only

    help me
  • whodgson
    Contributor
    • Jan 2007
    • 542

    #2
    char c='A';cout<<"c = "<<c;//prints 65
    float x=c;cout<<"x = "<<x;//prints 65 (not 65.0)but x is a float
    This is an example of promotion rather than conversion.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      Look up the function strtof in the standard C library

      Comment

      Working...