Check out a free preview of the full Go for JavaScript Developers course:
The "Pointers Exercise" Lesson is part of the full, Go for JavaScript Developers course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to write a function that takes in a pointer variable and uses it to modify the value the pointer is pointing to.

Get Unlimited Access Now

Transcript from the "Pointers Exercise" Lesson

>> So the goals here are gonna be to practice navigating between variables and pointers, learning how to use either the asterisk or the ampersand depending on what you're trying to accomplish, and kind of just have a little bit more exposure to creating and modifying structs. So for the directions, you're gonna define an instance of the user struct.

[00:00:17] You can either copy and paste the one we talked about earlier, create your own, whichever you so choose, and then write a function called update email, that's gonna take in that user type. And so the user type will have an email field on it, in that update email field function, update that user's email to something new.

[00:00:33] And then lastly, call update email from main and verify that the updated email has persisted. So you're gonna wanna call both update email and the original instance of that user struct, to make sure that the email was permanently modified in the example. So you'd like to copy this code to get started.

[00:00:53] It's just the boilerplate for the go template with a user struct ready to go for you here as well.