From 2768ac64a75f842a5c48c77f62762d0bb37d04b9 Mon Sep 17 00:00:00 2001 From: Muhammad Hafiz Azhari <80326383+mhafizazh@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:19:56 -0800 Subject: [PATCH] Update add dereference the pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dereference the pointer while (c+2 != '\0') to while(*(c+2) != ‘\0’) --- 13/exercises/06/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/13/exercises/06/README.md b/13/exercises/06/README.md index e035719f..6f21b81a 100644 --- a/13/exercises/06/README.md +++ b/13/exercises/06/README.md @@ -9,7 +9,7 @@ clarity. ```c void censor(char *str) { char *c = str; - while (c+2 != '\0') { + while (*(c+2) != '\0') { if (*c == 'f' && *(c+1) == 'o' && *(c+2) == 'o') *c = *(c+1) = *(c+2) = 'x'; c++;