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.

  • Corbin
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 day ago

    It’s not even an analogy; pointers and reference mechanics are the same concept in programming and linguistics. See the page on referents for an example blend of viewpoints.