Hook
More breakout videos from this creator.
C++ pointers. A pointer stores the memory address of a variable. I'm gonna make it more simple in a second, but let me full box this guy. Sorry, inventory starts with five empty slots. We're gonna pick up items, then we're gonna update our inventory. We're gonna go with the legendary AR, the green pump, the grappler, the chug splashes, and the minis. And you see reboot ended, so we have to clutch this. Now we have to update the code with the items that we picked up. Then we're gonna print out our inventory to make sure we have the right stuff in the right place. Now we're gonna create a pointer variable that points to the memory address of slot one. And remember, the asterisk is called a dereference operator, and the ampersand is called an address operator. And you see when we run this, we get the memory address of slot one. It looks kind of weird, but that's the memory address. All we have to do now is create pointers for slots one through five, then we're gonna print out the memory addresses for those. So I see a bro across the map, so I'm gonna use pointer one to lower his health, then I'm gonna switch to pointer three to grapple to him. All right, now I'm gonna smack bro, but I hit a pointer four and throw that chug splash just because. Then I walk around the corner, he just hiding there. I don't lie, I panic a little bit, but I still pump him. Then I go around the corner and jump up and catch him lacking. He tried to drop his weapon and beg for mercy, but that ain't gonna work with me. But now we gotta find the last guy. So I finally see some footsteps, y'all know I gotta get that pointer two and pump him real quick. Then I'm gonna switch to pointer one and I'm gonna gun him down with the recursive switch. And yes, I do have to emote.