I've been trying to read from a file into a string.
Then using atoi add up the ascii values of the characters in the string.
The "atoi" has been giving me values of 0.
Testing later on comfirms the instring values are proper.
If the first sequence of non-whitespace characters in str is not a valid integral number, or if no such sequence exists because either str is empty or it contains only whitespace characters, no conversion is performed.
It takes all the digits at the start of the string, and turns them into an integer. Your input strings have no digits in, so none of them will be converted.
You want something like this:
read the word
convert each character individually into its integer representation ( this being C++, static_cast spring to mind)
add those numbers together