Pointers Are Just Memory Addresses, Not Arrows: Rethinking C and C++

A widely shared explainer argues that the traditional whiteboard diagram of pointers as arrows between boxes misleads programmers learning C and C++. The article contends that a pointer is simply an integer storing a memory address, much like a house number on a street of numbered byte lockers in RAM. Variable names like 'score' exist only for human readability and vanish entirely once code compiles into machine instructions, leaving the CPU to work solely with numeric addresses. On a 64-bit system, every pointer occupies exactly 8 bytes regardless of the data type it references, because an address is always the same size. The piece suggests that viewing memory this way demystifies pointer arithmetic, array decay, and segmentation faults, recasting the last as a protective operating system feature rather than a random error.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in