Quote:
for large strings.The output is not correct
Of course, it is not. You are adding the index
i
to the character code in order to obtain a new character code, but
i
, for large strings is, well..., large.
So, if you really need to add
i
the you have to 'put back' the character code in the allowed range (e.g.
'a',..,'z'
). You need the modulo operator
%
for such a job.