Thread: Is this analogy for pointers (*operator), addresses (& operator) and variables valid?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2016
    Posts
    45

    Is this analogy for pointers (*operator), addresses (& operator) and variables valid?

    I was wondering if this is the right way to think about pointers (*operator), addresses (& operator) and variables. I'm giving a simplified explanation in the black boldface text, and a more technical one in red.

    I'm trying to create a simplistic mental map in my head so I can instinctively remember what all these components actually are. (Sort of like a pneumonic device). I'm having trouble wrapping my head around the relationships between the three concepts


    -A pointer variable---which is denoted by the *operator (indirection)---is like an arrow that can point to an address. It is technically a variable that can store an address. You will have to initialize it to an address with the &operator for it to point to something.

    -An address---which is denoted by the &operator---is like the physical location that stores a value of the variable of interest to the user. It corresponds with a physical byte location in memory.

    -A variable is the data (of a certain type---int, float, char, etc) that the user wants to store. A sequence of 1's and 0's located at a physical address in memory
    Last edited by potomac; 12-25-2016 at 12:37 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 31
    Last Post: 05-26-2016, 05:21 PM
  2. Ternary Operator to choose which operator to use
    By cncool in forum C Programming
    Replies: 7
    Last Post: 06-27-2011, 01:35 PM
  3. Replies: 3
    Last Post: 12-09-2008, 11:19 AM
  4. Replies: 2
    Last Post: 07-07-2008, 03:46 AM
  5. Replies: 1
    Last Post: 07-07-2008, 03:38 AM

Tags for this Thread