From f900b640a0f72b0ec7b327e2c98c22a946693cdc Mon Sep 17 00:00:00 2001 From: FlyvendeThom Date: Mon, 15 Oct 2018 19:54:48 +0200 Subject: [PATCH] Note added for strings as arrays (#18597) --- client/src/pages/guide/english/c/pointers/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/guide/english/c/pointers/index.md b/client/src/pages/guide/english/c/pointers/index.md index 25b51b9a70..597a37c0e8 100644 --- a/client/src/pages/guide/english/c/pointers/index.md +++ b/client/src/pages/guide/english/c/pointers/index.md @@ -66,7 +66,7 @@ Notice that the `*` is required before each variable. This is because being a po ## Practical Uses of Pointers ### Arrays -The most common application of a pointer is in an array. Arrays, which you'll read about later, allow for a group of variables. You don't actually have to deal with `*` and `&` to use arrays, but that's what they're doing behind the scenes. +The most common application of a pointer is in an array. Arrays, which you'll read about later, allow for a group of variables. You don't actually have to deal with `*` and `&` to use arrays, but that's what they're doing behind the scenes. A commonly used array is for strings. Since strings are not defined in C, they are simply created as a character array, commonly denoted by `char * stringName;` ### Functions Sometimes you want to adjust the value of a variable inside of a function, but if you simply pass in your variable by-value, the function will work with a copy of your variable instead of the variable itself. If, instead, you pass in the pointer pointing to the memory location of the variable, you can access and modify it from outside of its normal scope. This is because you are touching the original memory location itself, allowing you to adjust something in a function and having it make changes elsewhere. In contrast to "call by value", this is called "call by reference".