char *string = "-123"; int i = atoi(string);
char myarray[5] = {'-', '1', '2', '3', ' '}; int i; sscanf(myarray, "%d", &i);