Update main.c

A new method stringToInt is added.