At the very least lay out the answer. I fully get "I don't want to help you cheat" but if you have a question like "How do I reverse a string?" You CAN answer the question without making it copy and pastable.
"Go through the string to get the length of the string, or use Strlen() Then use a for loop to cycle between 0 to half the length. For each value, exchange the string pointer + integer with string pointer + length - integer. Now you should have a reversed string" should be a good answer.
I've left a few minor issues and a few optimizations as well as edge cases in there as well, I answer the question but still leave the OP the challenge of coding it and improving it, and testing it.
160
u/Kinglink Feb 05 '18
Often times I've seen "That's clearly homework". OK but answer the question. Let the professor worry about if he's a cheater.