String Reverse In-place
C
Easy
3 views
Problem Description
Reverse a string without extra arrays. Two pointer technique: swap characters from the start and end until they meet in the middle.
Official Solution
#include <stdio.h>
int main() {
char str[100];
int start = 0, end, i;
char temp;
printf("Enter a string: ");
fgets(str, sizeof(str), stdin);
// Find length manually
end = 0;
while (str[end] != '