K&R C Exercise 1-19: Reverse a String in C
Exercise 1-19. Write a function reverse(s) that reverses the character string s. Use it to write a program that reverses its input a line at a time. Approach The core algorithm is the classic two-pointer swap: place one index at the start of the string (i = 0) and one at the end (j = …