The code has a header, implementation, and main files. It is supposed to increment the ASCII value of all characters in the string then return the character value associated with that ASCII value.
The code in question is as follows:
for(int i = 0; i < sizeof(letters); i++)
{
if ((int)letters.at(i) >= (int)'a' && (int)letters.at(i) <= (int)'z')
{
letters.at(i) = (((letters.at(i) - 'a') + 1) % 26 + 'a');
}
else if ((int)letters.at(i) >= (int)'A' && (int)letters.at(i) <= (int)'Z')
{
letters.at(i) = (((letters.at(i) - 'a') + 1) % 26 + 'A');
}
}
Unhandled exception at 0x750A3DB2 in HomeworkNine.exe: Microsoft C++ exception: std::out_of_range at memory location 0x00EFF7E8. occurred
I do not see where the out of bounds is, since I thought the modulus would take care of that.