this post was submitted on 18 May 2025
0 points (50.0% liked)

Programming

20211 readers
167 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] Ryick@lemm.ee 1 points 21 hours ago* (last edited 21 hours ago)

To be a bit more specific, a word is nothing more than a set of symbols (physical) which indicate an agreed value (abstract/reference). A pointer is the word and the agreed value is the reference of the object. The object the pointer points to is the existence of the real object (physical) and its value(s) which exists regardless of abstract references.

Pattern: physical -> reference -> physical -> value

Double pointer pattern: physical -> reference -> physical -> reference -> physical -> value

Etc…

A word’s meaning can change through time as cultures rise and fall, for the temporary purpose of encrypting conversations (e.g. the word “dog” can point to the agreed value of “fork” or “7”), or even misidentification.