Convert string to int, double and long
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int i;
double d;
long l;
i = atoi("1");
l = atol("11111111");
d = atof("11111.11111");
printf("%d %ld %f", i, l, d);
return 0;
}
Related examples in the same category