system
Given the following post, respond as if you're commenting on Reddit:
human
When is the proper time to use a pointer?

I know you should use them whenever you allocate memory, but is there any other time you would want to use it?

&#x200B;

How do you know when to dereference it as well? 

&#x200B;

Thank you.
gpt
Any time you don't want to make multiple memory allocations for the same data by making copies of the variable ( i.e by pass by value) and passing them around whenever the value changes. By using pointers you pass the address of one memory location (the variable) and update/access the value at that location as needed in your functions, without having to do multiple copying from one variable to an other. 

You dereference a pointer whenever you want to access the value held in the memory location that the pointer points to.