Re: Problem with atoi and strlod
On Sun, 13 Apr 2008 09:50:50 -0700 (PDT), Sanchit
<sanchitgupta.1@gmail.com> 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.
You some objection to strtol?
Remove del for email
|