Skip to content

Commit d50ea33

Browse files
authored
Update reverse.c
Reset static variables after string-reverse process completed, making the function reusable
1 parent 4571c04 commit d50ea33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapter_4/exercise_4_13/reverse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void reverse(char str[])
2727

2828
str[j++] = c;
2929
}
30-
if (s[j] == '\0') // if whole reverse process is complete, reset the static variables to make this function reusable
30+
if (str[j] == '\0') // if whole reverse process is complete, reset the static variables to make this function reusable
3131
{
3232
i = 0;
3333
j = 0;

0 commit comments

Comments
 (0)