I'm working on some c++ homework and am unsure as to why my code isn't reversing my string. pastebin of my code: http://pastebin.com/5NM8bynX line 88 is where my function starts. Here's some test output: Enter a word: test You entered this word: test There are 1 vowels in the word, test. debug: temp[i]: t input[j]: t debug: temp[i]: s input[j]: s debug: temp[i]: e input[j]: e debug: temp[i]: t input[j]: t end of forloop, temp: This is your word in reverse print: so it looks like i have the right idea going but i'm unsure as to why it now doesn't print it out.
Well interesting. Changing my function from temp[i] = input[j] to temp += input[i]; (changed my forloop so i had less variables declared) worked. I'll have to ask why this is.
Join our real-time social learning platform and learn together with your friends!