Re: how to pass float value from argv?
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Sun, 10 May 2009 10:56:15 +1200
Richard Heathfield wrote:
Sunny said:
<snip>
It would be better to try not to use atoi()/atof().
Agreed.
If you read
the C manual. It clearly says that both atoi() and atof() has been
deprecated by strtol() and strtod()
Which C manual? If you mean the Standard, C&V please. If you mean the man pages, mine don't say any such thing.
Some do, the (Open)Solaris page says:
Calls to atoi() and atol() might be faster than correspond-
ing calls to strtol(), and calls to atoll() might be faster
than corresponding calls to strtoll(). However, applications
should not use the atoi(), atol(), or atoll() functions
unless they know the value represented by the argument will
be in range for the corresponding result type.
--
Ian Collins
.
- Follow-Ups:
- Re: how to pass float value from argv?
- From: Keith Thompson
- Re: how to pass float value from argv?
- References:
- how to pass float value from argv?
- From: miloody
- Re: how to pass float value from argv?
- From: Willem
- Re: how to pass float value from argv?
- From: Sunny
- Re: how to pass float value from argv?
- From: Richard Heathfield
- how to pass float value from argv?
- Prev by Date: Re: Library functions
- Next by Date: Re: Porting a c program
- Previous by thread: Re: how to pass float value from argv?
- Next by thread: Re: how to pass float value from argv?
- Index(es):
Relevant Pages
|