Skip to content · ⁨コンテンツへスキップ⁩

Reverse in place · ⁨インプレイス逆転⁩

English

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ストリングをインプレイで逆転します——新しいストリングを作成するのではなく、同じ配列内の文字を書き換えます。古典的な手法:左インデックスを先頭に、右インデックスを末尾に設定して交換し、両方が中央で出会うまでそれぞれ中央へ向かって進めます。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP