atol(), atof(), atoi() function behaviours, is there a stable way to convert from/to string/integer
- by Berkay
In these days i'm playing with the C functions of atol(), atof() and atoi(), from a blog post i find a tutorial and applied:
here are my results:
void main()
char a[10],b[10];
puts("Enter the value of a");
gets(a);
puts("Enter the value of b");
gets(b);
printf("%s+%s=%ld and %s-%s=%ld",a,b,(atol(a)+atol(b)),a,b,(atol(a)-atol(b)));
getch();
}
…