Skip to content

Commit

Permalink
Mention #value explicitly in Pointer overview. (#12184)
Browse files Browse the repository at this point in the history
Also a minor grammar change.
  • Loading branch information
elebow authored Jul 3, 2022
1 parent cbc67c1 commit b2dc03a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pointer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require "c/string"
# to implement efficient data structures. For example, both `Array` and `Hash` are
# implemented using pointers.
#
# You can obtain pointers in four ways: `#new`, `#malloc`, `pointerof` and by calling a C
# You can obtain pointers in four ways: `#new`, `#malloc`, `pointerof`, or by calling a C
# function that returns a pointer.
#
# `pointerof(x)`, where *x* is a variable or an instance variable, returns a pointer to
Expand All @@ -21,6 +21,8 @@ require "c/string"
# x # => 2
# ```
#
# Use `#value` to dereference the pointer.
#
# Note that a pointer is *falsey* if it's null (if its address is zero).
#
# When calling a C function that expects a pointer you can also pass `nil` instead of using
Expand Down

0 comments on commit b2dc03a

Please sign in to comment.