Jul 27, 2012 at 1:48pm UTC
use std::swap from the header <algorithm>
EDIT: Why on Earth would you use POINTERS????
Last edited on Jul 27, 2012 at 1:50pm UTC
Jul 27, 2012 at 2:05pm UTC
I don't like using pointers, but this question is a homework practice, for recursion
Jul 27, 2012 at 2:23pm UTC
Pointers are a pretty big part of programming, I'd start learning to like them. They aren't some mysterious magical device used to confuse you, they're used all over the place in computers.
Jul 28, 2012 at 6:55am UTC
I wonder ... instead of using int n
couldn't you just check to see if *s == '\0'
?
Last edited on Jul 28, 2012 at 6:57am UTC
Jul 28, 2012 at 8:22am UTC
@TwoOfDiamonds
I wonder ... instead of using int n couldn't you just check to see if *s == '\0' ?
It is possible only for the first recursive iteration. And what about subsequent iterations?!
Last edited on Jul 28, 2012 at 8:23am UTC
Jul 31, 2012 at 9:00am UTC
Thanks for every answers given. Like what I said my code is a mess that int n=0 is just a code that I reference from other questions.
Last edited on Jul 31, 2012 at 9:01am UTC