like when when s = "wendy", I got 551. What's that?
for(size_t i = 0; i < s.length(); i++)
{
sum += s.at(i);
}
like when when s = "wendy", I got 551. What's that?
for(size_t i = 0; i < s.length(); i++)
{
sum += s.at(i);
}
It's the sum of the ascii values in the string. Each character corresponds to a numerical value usually between 32 and 127 (ignoring wide characters and Unicode stuff for now since that's complicated).
If you want more information, try looking up "Ascii".
From an ascii table:
'w' = 119
'e' = 101
'n' = 110
'd' = 100
'y' = 121
---
551