Hi guys, I'm replacing 4 letter lower case words with "----" and "|---" for 4 letter words that start with capital letters, my program works except whenever it starts up the dialogue pops up with Debug Assertion Failed, I think has something to do with my cin>>w;, but if I move it outside the while loop it can't stop. Any suggestions to fix it?
it might be something related to the beginning of your loop. Suppose you start the program, at line 9 w is an empty string, w.length() is 0, so w[-1] is what your compiler will probably complain about.