I am having trouble in printing jumbled words for an input word. There is something really silly thing in my program I am missing. Can someone eyeball this and tell me what could be wrong in this code? Your help is much appreciated.
Line 17: temp.length() == 0
Line 19: Access to temp[temp.length()], which shall not be modified.
Line 25: Access to temp[X], where X > temp.length(), is undefined behaviour.