Reverse 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.
הפכה במקום
הפוך מחרוזת C במקום — שינה את התווים באותו מערך במקום לבנות מחרוזת חדשה. התנועה הקלאסית: מדד שמאלי בתחילה ומדד ימני בסוף, החלף אותם, ואז צעד את שניהם לכיוון המרכז עד שיפגשו.
Complete void reverse_in_place(char *s) to reverse the C-string s in place (modify the same array). Do not write main. · השלם את void reverse_in_place(char *s) כדי להפוך את מחרוזת ה-C s במקור (לשנות את אותו מערך). אל תכתוב main.
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.