Mega Code Archive
Categories
/
C
/
Code Snippets
Convert string to int, double and long
#include
#include
int main(int argc, char *argv[]) { int j; double d; long l; j = atoi("1"); l = atol("11111.111"); d = atof("111.11111"); printf("%d %ld %f", j, l, d); return 0; }