Reverse in place · Inverser in place
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.
Inverser in situ
Inversez une chaîne C in situ — modifiez les caractères dans le même tableau plutôt que de construire une nouvelle chaîne. Le mouvement classique : un index gauche au début et un index droit à la fin, échangez-les, puis avancez les deux vers le milieu jusqu'à ce qu'ils se rencontrent.
Complete void reverse_in_place(char *s) to reverse the C-string s in place (modify the same array). Do not write main. · Complétez void reverse_in_place(char *s) pour inverser la chaîne C s in place (modifier le même tableau). N'écrivez pas main.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.