Reverse in place · Invertir in situ
Reverse in place
Reverse a C-string in place — change the characters in the same array rather than building a new string. The classic move: a left index at the start and a right index at the end, swap them, then step both toward the middle until they meet.
Invertir in situ
Invierta una cadena C in situ — cambie los caracteres en el mismo array en lugar de construir una nueva cadena. El enfoque clásico: un índice izquierdo al inicio y un índice derecho al final, intercámbielos, y luego avancen ambos hacia el centro hasta que se encuentren.
Complete void reverse_in_place(char *s) to reverse the C-string s in place (modify the same array). Do not write main. · Complete void reverse_in_place(char *s) para invertir la cadena C s in situ (modificar el mismo array). No escriba main.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.