Nov 6, 2010 at 2:00am UTC
char CharCount[userinput.length()];
This is illegal. The size of an array must be know in compilation time.
why are you mixing char[] with string?
Check your loops:
__line 8,20 should be < (from 0 to n-1)
__line 13 will never execute.
You can do a reverse of the word in-place.
Last edited on Nov 6, 2010 at 2:02am UTC
Nov 6, 2010 at 2:59am UTC
I said compilation time. In your example, you will know userinput.length() when the program is already running.
ISO C++ forbids variable length array. Your compiler may have an extension that allows you to do that, but is against the standard.
Last edited on Nov 6, 2010 at 3:01am UTC