Re: Convert String To Number

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 06/15/04


Date: Tue, 15 Jun 2004 13:51:40 -0400


"JLO" <geomapa@cybercable.net.mx> wrote in message
news:%23zAZtCwUEHA.1764@TK2MSFTNGP10.phx.gbl
> Hello. i'd like to convert the string from my editbox to number for
> making some mathematic operations.

sscanf, atoi, strtol, StrToInt, VarI4FromStr - pick one. Or, you can get
the number straight from the box - see GetDlgItemInt

-- 
With best wishes,
    Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Relevant Pages

  • Re: Check all errors in code?
    ... The atoi function converts the initial portion of the string ... pointed to by nptr to int representation. ... The atoi function returns the converted value. ... The strtol function returns the converted value, ...
    (comp.lang.c)
  • Re: question
    ... strtod is capable of telling you about errors. ... Use that capability. ... I am just used to using atoi. ... I'll check out strtol. ...
    (comp.lang.c)
  • Re: how to pass float value from argv?
    ... Calls to atoi() and atol() might be faster than correspond- ... ing calls to strtol(), and calls to atoll() might be faster ...
    (comp.lang.c)
  • Re: how to pass float value from argv?
    ... Calls to atoi() and atol() might be faster than correspond- ... ing calls to strtol(), and calls to atoll() might be faster ...
    (comp.lang.c)
  • Re: how to pass float value from argv?
    ... It clearly says that both atoi() and atof() has been ... deprecated by strtol() and strtod ... The man pages on Ubuntu ...
    (comp.lang.c)