From 5606023aaee55ca48ab67314068adbd20854a29d Mon Sep 17 00:00:00 2001 From: yoadwo Date: Wed, 19 Dec 2018 11:12:59 +0200 Subject: [PATCH] Update Index.md (#24095) added clarification: strlen() does not include the null-termination character --- guide/english/c/arrays-and-strings/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guide/english/c/arrays-and-strings/index.md b/guide/english/c/arrays-and-strings/index.md index 5786c24f619..d3394f923f8 100644 --- a/guide/english/c/arrays-and-strings/index.md +++ b/guide/english/c/arrays-and-strings/index.md @@ -178,7 +178,8 @@ strncat(char s1[], char s2[], int n); #### Get length: `strlen` -`strlen` (from 'string length') will return an integer value corresponding to the length of the string. In this example, an integer called `string_length` will be assigned the length of `my_string`: +`strlen` (from 'string length') will return an integer value corresponding to the length of the string. Even though all strings are terminated with a \0 character, it will not be included in the count (so the length "hello" is indeed 5 and not 6). In this example, an integer called `string_length` will be assigned the length of `my_string`: + ```C string_length = strlen(my_string); ```