Pointers!

So after watching the lecture and reading some of the C++ page:
http://www.cplusplus.com/doc/tutorial/pointers/

Points can do a very interesting thing.
A pointer can get / set the value of a set address. Meaning it will always get the value stored in that address or be able to change it at that address.

Granted you need the & address first to get this but when they’re both combined you can do some pretty powerful things demonstrated by the declaring pointers section.

Where it sets mypointer to an integer’s address then uses a pointer version of *mypointer to set that address’s value and move onto another after.

If you use this with an array it lets you easily go back and forth changing individual addresses within that array pretty easily.

Which seems kinda cool.

I probably explained this poorly but I am sort of getting it.

1 Like

Privacy & Terms