diff --git a/problems/0344.反转字符串.md b/problems/0344.反转字符串.md index a5f18d58..b08c3f21 100644 --- a/problems/0344.反转字符串.md +++ b/problems/0344.反转字符串.md @@ -218,7 +218,19 @@ func reverseString(_ s: inout [Character]) { } ``` +C: +```c +void reverseString(char* s, int sSize){ + int left = 0; + int right = sSize - 1; + while(left < right) { + char temp = s[left]; + s[left++] = s[right]; + s[right--] = temp; + } +} +``` -----------------------