Example 1

 

#include <stdlib.h>
#include <stdio.h>

int main(void)
{
   int n;
   char *str = "12345.67";

   n = atoi(str);
   printf("string = %s integer = %d\n", str, n);
   return 0;
}

Hosted by www.Geocities.ws

1