Skip to content

Commit

Permalink
explain what the %p placeholder prints (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz authored Jun 3, 2024
1 parent 0619712 commit 9e0e9a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pointers-and-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func (w Wallet) Deposit(amount int) {
}
```

The `\n` escape character prints a new line after outputting the memory address.
We get the pointer (memory address) of something by placing an `&` character at the beginning of the symbol.
The `%p` placeholder prints memory addresses in base 16 notation with leading `0x`s and the `\n` escape character prints a new line.
Note that we get the pointer (memory address) of something by placing an `&` character at the beginning of the symbol.

Now re-run the test

Expand Down

0 comments on commit 9e0e9a2

Please sign in to comment.