Sudoku Build

how do I convert a numeric cpp string into an integer value?
I am writing a little Sudoku program as a refresher before my class starts this semester and have run into a few issues(most of which have already been remedied)
I am writing a C++ console app in visual studio 2005 that will accept entries(layout of a fresh sudoku board… from a newspaper or other source), store it in a file for later use, and read back from the file… more functionality may be built in later
the problem I have is that I am storing all the numerical data in a text form in the file and am having difficulty converting the characters/strings in the file back to integer type data for the program to work with
any suggestions?
One way to do this is with the atoi function.
Also, it is not very hard to write your own:
//assumes str is a legal integer
int atoi ( char *str )
{
int i = 0;
while (*str != ‘
