3 int stringLength(const char* str
) {
6 while (str
[result
] != '\0') {
13 void swap(char* v1
, char* v2
) {
19 void reverseString(char* str
) {
20 int length
= stringLength(str
);
21 int halfLength
= length
/ 2;
23 for (int charId
= 0; charId
< halfLength
; ++charId
) {
24 swap(&str
[charId
], &str
[length
- charId
- 1]);
29 char msg
[] = "Votre message";
30 printf("Initial value: \"%s\"\n", msg
);
32 printf("Reversed : \"%s\"\n", msg
);