If it is a string, it is char*, using atoi:
int atoi(char *str)
The string to be converted to an integer.
For example:
# include & ltstdlib.h & gt
# include & ltstdio.h & gt
int main(void)
{
int n;
char * str = " 12345.67 ";
n = atoi(str);
printf("string = %s integer = %d ",str,n);
Returns 0;
}