Reversing a string in C
If you want to practice advanced features of C, how about pointers? We can toss in macros and xor-swap for fun too! #include <string.h> // for strlen() // reverse the given null-terminated string in place void inplace_reverse(char * str) { if (str) { char * end = str + strlen(str) – 1; // swap the … Read more