From 751a20903a6c57a374c669c8aabea6069fd90e2e Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 7 Nov 2017 17:52:28 -0500 Subject: [PATCH] Sneak in a little note about dereferencing Fixes #648 --- second-edition/nostarch/chapter04.md | 5 +++++ second-edition/src/ch04-02-references-and-borrowing.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/second-edition/nostarch/chapter04.md b/second-edition/nostarch/chapter04.md index 2ab3fd1d3..263e06565 100644 --- a/second-edition/nostarch/chapter04.md +++ b/second-edition/nostarch/chapter04.md @@ -596,6 +596,11 @@ without taking ownership of it. Figure 4-5 shows a diagram. Figure 4-5: `&String s` pointing at `String s1` +> Note: The opposite of referencing by using `&` is *dereferencing*, which is +> accomplished with the dereference operator, `*`. We’ll see some uses of the +> dereference operator in Chapter 8 and discuss details of dereferencing in +> Chapter 15. + Let’s take a closer look at the function call here: ``` diff --git a/second-edition/src/ch04-02-references-and-borrowing.md b/second-edition/src/ch04-02-references-and-borrowing.md index d89277c63..c5aa5ef2a 100644 --- a/second-edition/src/ch04-02-references-and-borrowing.md +++ b/second-edition/src/ch04-02-references-and-borrowing.md @@ -37,6 +37,11 @@ without taking ownership of it. Figure 4-5 shows a diagram. Figure 4-5: `&String s` pointing at `String s1` +> Note: The opposite of referencing by using `&` is *dereferencing*, which is +> accomplished with the dereference operator, `*`. We’ll see some uses of the +> dereference operator in Chapter 8 and discuss details of dereferencing in +> Chapter 15. + Let’s take a closer look at the function call here: ```rust