Reverse in place · กลับด้านใน 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.
กลับหัวใน-place
กลับหัว C-string in place — เปลี่ยนตัวอักษรใน array เดิมแทนการสร้าง string ใหม่ การเคลื่อนไหวคลาสสิก: index ทางซ้ายที่จุดเริ่มต้นและ index ทางขวาที่จุดสุดท้าย สลับกัน แล้วขั้นทั้งสองเข้าหาจุดกึ่งกลางจนกว่าจะพบกัน
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-string s ใน place (แก้ไขarray เดียวกัน). อย่าเขียน main
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่