Skip to content

Commit dfefac0

Browse files
authored
Update ch05-03-method-syntax.md
In Chapter 5-3 (Methods), variable named object was used to describe a pointer (in C/C++ etc). It would be more reasonable to name it pObject instead.
1 parent 8c0eacd commit dfefac0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ch05-03-method-syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ are and how to designate a field or method as public or private in [Chapter
9797
> In C and C++, two different operators are used for calling methods: You use
9898
> `.` if you’re calling a method on the object directly and `->` if you’re
9999
> calling the method on a pointer to the object and need to dereference the
100-
> pointer first. In other words, if `object` is a pointer,
101-
> `object->something()` is similar to `(*object).something()`.
100+
> pointer first. In other words, if `pObject` is a pointer,
101+
> `pObject->something()` is similar to `(*pObject).something()`.
102102
>
103103
> Rust doesn’t have an equivalent to the `->` operator; instead, Rust has a
104104
> feature called _automatic referencing and dereferencing_. Calling methods is

0 commit comments

Comments
 (0)