Have you thought about using "atoi"? (Hint: You're not the first person to ask this question, just the first this week)