another i'm sure easy question.
here, as an exercise, i made a simple case-reverser and i'm trying to figure out how to impose limits on user input so no overwrite of adjacent memory occurs. as it is, the loop catches any input length <1 or >10 but the overwrite still occurs if the user enters a too-long string at first. i just chose 10 as an arbitrary string length to experiment with and the for loop on line 23 was just a diagnostic thingy for me to verify that the overwrite was in fact occurring.
Why not use a string variable instead of a char[].
It worries me that you specify a length to the char array, without knowing how many characters the user might input. Although, the compiler might still compile it, and as you say, store the chars in adjacent memory locations. I would use the string class.