Alibaba Group interview question

Implement atoi in c