Please use code tags, because it's a lot easier to read.
Well one issue is that digitToInt is a function of type void and it should be a function of type int.
You'll have to change your prototype and function definition from void to int like this for example
int digitToInt(string number);
Another issue with your code is in main you aren't setting anything to be what your digitToInt(13531); is returning.
You should be doing something like
|
int digitAsInt = digitToInt(13531);
|
in your main.
Another issue with the code you posted is int main doesn't return anything. (However, this is irrelevant to your current issue.)
Edit:
Also
return number.at;
I don't believe you can do it this way.
You should do either
return number.at(0);
or
return number[0];
That being said, you are returning the character value with this approach.
To get the integer value, you have to subtract '0' from each character.
See
http://www.asciitable.com/