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.

  • Ryick@lemm.eeOP
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    That is a simple and good analogy, and, yes, perhaps better than my own.

    Whether the pointed data by the pointer is valid or not is… not the point.

    Nor is that the point of my analogy, but I do see how you inferred that point. Your criticism has helped me identify a flaw in how I express the analogy.