If the string was cab
How would I convert to an ascii value so it would be 294?
thanks.
Sum the values of the characters:
string[0] + string[1] + ... + string[length-1]
and cast the result to an integer
Last edited on
how would you do that?
Im sort of new to c++
I'd suggest you a for
loop, from 0 to the string length-1 and use subscripting to add to the sum:
sum += yourstring[i];
Last edited on
subscripting is the [ ] operator