After testing I have noticed when I put this for example: cout<<hex<<(int)text[i]+111 << "\n";
it gives me wrong result.
But when I add number 1 it gives me correct result.
Why it happens?
Why are you adding anything at all? If you want the numeric ASCII value, then don't do any math on it. -- It just doesn't make sense to add letters together.
With the numeric digits ('0'..'9', which are ASCII 48..57), it is common to want to convert that into the actual digit value. So, the formula is
int value = (char)digit - '0';