atoi()

The atoi() function takes a string (which represents an integer) as an
argument and returns its value.

Following is a simple implementation. We initialize result as 0. We
start from the first character and update result for every character.