Microsoft interview question

Implement the "atoi" function in C