Oct 27, 2013 at 11:45pm UTC
how do you reverse a string? For example if the string is 123 and you want it changed to 321.
Last edited on Oct 28, 2013 at 1:04am UTC
Oct 28, 2013 at 12:57am UTC
Get a deck of cards, ¿how would you reverse it?
Oct 28, 2013 at 1:07am UTC
What? How does that relate to the problem?
Last edited on Oct 28, 2013 at 1:07am UTC
Oct 28, 2013 at 1:08am UTC
It's a real life example of how to solve the programming problem. The answer to both are (or can be) the same.
Last edited on Oct 28, 2013 at 1:09am UTC
Oct 28, 2013 at 1:16am UTC
oh, um I'd make the last one the first and go from there.
Oct 28, 2013 at 1:44am UTC
Is there a reverse function or something? I couldn't find one.
Oct 28, 2013 at 2:00am UTC
Yes, there is. But it has it's draw backs. A simple Google search would show you that the algorithm header has a reverse function. Though I would recommend making your own reversing algorithm.
Oct 28, 2013 at 2:02am UTC
I don't even know where to start to make a reversing algorithm. Can someone at least give me a hint or idea of how to?
Oct 28, 2013 at 2:08am UTC
Wat.... pretty sure you're over complicating.
Make two strings. Put the last character in the source string as the first character in the destination string. So on...
Oct 28, 2013 at 2:13am UTC
but how do you get the characters starting from the last?
Oct 28, 2013 at 2:17am UTC
I haven't learned how to use arrays yet :(
Oct 28, 2013 at 2:19am UTC
Last edited on Oct 28, 2013 at 2:20am UTC