13/04/2008, 18h56
|
#2
|
|
|
Re: Problem with atoi and strlod
Sanchit wrote:
>
> #include<stdio.h>
> #include<stdlib.h>
>
> int main()
> {
> double ans;
> ans = strtod("25", NULL);
> printf("ans = %d\n",ans);
>
> }
>
> OUTPUT :
> ans = 0
>
> EXPECTED OUTPUT
> ans = 25
>
> Can anyone please explain this... Else tell me an alternative for
> converting string to int.
try %f
--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto/
|
|
|
|