1 Attachment(s)
Help with Backward function
Can someone please help me with my program it says there is no problem with the build but when exe. it displays a bunch of backward 'k' instead of reversing the words entered.
Problem: Enter in a C-string and use function to display the word backward. (it might help with a pointer but im not sure how to go about it)
Attachment 31343
Re: Help with Backward function
Set a break point in the begin of your display function, Press F5 to start debugging, then press F10 for each next step... and look at the debug windows ("Auto", Watch", ...) to see what happens with your variables... Then you'll be able to know what and why goes wrong.
Re: Help with Backward function
Please post the code here (with code tags) rather than providing a web link. Some of us don't open links from unknown sources so won't be able to provide guidance.:wave:
Re: Help with Backward function
Quote:
Originally Posted by
2kaud
Please post the code here (with code tags) rather than providing a web link. Some of us don't open links from unknown sources so won't be able to provide guidance.:wave:
Well, it is not an external link... It is just the attachment to his/her post.
However, I agree that inserting this code in the OP (with Code tags, of course!) would be much better.
Re: Help with Backward function
Most of your array is just unitialized garbage. When you reverse the entire array, that's what you see. Your loop should only cover the string that was entered, not the entire buffer.