Reverse an array of char in place.
Code: void strRev(char *s) { for(char *end = s + (strlen(s) - 1); (end > s) ; (*s++) ^= (*end) ^=(*s) ^= (*end--)); }
void strRev(char *s) { for(char *end = s + (strlen(s) - 1); (end > s) ; (*s++) ^= (*end) ^=(*s) ^= (*end--)); }
There are currently 1 users browsing this thread. (0 members and 1 guests)
View Tag Cloud
Forum Rules
Bookmarks