Reverse char array
I need help trying to figure out how to do a reverse of a char.
void reverse(char s[])
for ex. 'Bat' becomes 'taB'
1 2 3 4 5 6 7 8
|
#include <algorithm>
#include <cstring>
void reverse(char s[])
{
unsigned s_len = std::strlen(s) ;
std::reverse(s, s+s_len) ;
}
|
Thank you.
Topic archived. No new replies allowed.