FactSet interview question

write a function for atoi(string) ?