Pointers in C can often be difficult to understand—I certainly had a learning curve and am continuing to learn. However, I had a thought that may help some by comparing a common experience and wanted to share.
A pointer in C behaves just like a word in any spoken language which refers to a physical object or multiple objects and the uniqueness of each object (e.g Skippy the dog, Mittens and Tiger the cats, fork number 5). The word itself does not contain the physical object and its uniqueness but only communicates the existence of the physical object and its uniqueness. The pointer itself does not contain the physical address and its value but only communicates the existence of the physical address and its value.
Human language has 2 layers. Signifier and signified. Computers have 3. Signifier (variable name), memory address, (no human analog) and signified. (stored value) A pointer would be a signifier (word) for which the signified is the non-existent human analog to a memory address. You can have a word that refers to a thing that doesn’t exist (e.g. unicorn) but it won’t help the analogy.
In your example, the signifier ‘coffee’ is akin to a variable name. It is a signifier that dereferences to a value within the scope of our agreement. We can agree it holds the stored value of 65, allowing us to say something like butter = coffee - 60, bring me ‘butter’ eggs, but we don’t have a memory address system so it’s not the same process as a computer.
For a computer, there is a middle step to a variable dereference. It sees ‘coffee’ and first looks at the table of references, finds the variable ‘coffee’ has it’s value stored at address 1
['coffee':1, 'butter':88, 'unicorn':73]
and then pulls the value (65) from the memory at address 1. A pointer would be another variable, such as ‘*monkey’ (e.g.*monkey = &coffee
, which can be read as “pointer monkey shall hold the value of the address at which coffee is stored”) which would be added into the reference table as a variable stored at another address, say address 2, and would store in address 2 a value of (1).word address value coffee 1 65 *monkey 2 1
Language just doesn’t have the analogous concept.
Just because we don’t have to consciously think about where data is stored in our brains doesn’t mean that our brains don’t have a memory address system. How often do you have to consciously maintain your heart beat, calculate the orientation of your body, or identify that the two objects in front of you are similar enough to be a set of objects—two dogs. You don’t. They are unconscious/automatic functions.
In a computer, checking a memory address would be closer to what we would call ‘conscious’ actions in a person. It is performed actively by software. In a brain, we still don’t really have a full understanding of how memory is stored, but we at least know it isn’t part of our experience that we have explicitly defined storage locations that we address. If it were, we’d have a name for it. Computers and brains are metaphorically similar but structurally and functionally quite different.
You have a very good point. I would personally say that there is a physical difference between a computer and human, but that they are logically equivalent, within the scope of our discussion, even if the human processes are unconscious, because, objectively, the processes are occurring and have logical equivalence in that they are both memory address systems; just as a number and letter can have logical equivalence as symbols.
Also, I realize that I do not have the evidence that our brains do operate on a memory address system, and since it is my claim the burden of proof is on me. However, lack of evidence on my part is not evidence for an opposing idea, meaning the correct answer, for now, is “I don’t know.”
Have a wonderful day! 😁