添加 0344.反转字符串.md C语言版本

This commit is contained in:
Arthur
2021-10-22 16:28:50 +01:00
parent 712ab9aa00
commit fb7a575c05

View File

@ -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;
}
}
```
-----------------------