Rene Larsen wrote:You need to have two variables - one that count down (x -> 0) and one counting up (0 -> x)
That or use a calculation for one of the two array accesses. Like s1.length() - 1 - i. The two variables would be easier though.
Nelson, one hint: instead of using "new char", use "new char[s1.length()]". That will a) allow you to use strings larger than 26 characters, and b) not take up space for 26 characters if fewer (e.g. 5) are needed.