Thread: C pointer

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    102

    C pointer

    My lecturer just teach us some basic C Pointer. Can someone more briefly explain about & and * in C pointer. I'm kinda confused.

    Here's my though
    1. &a > Refer to the L-value of variable.
    2. *aPtr > Refer to the value of aPtr?<<<<Not very sure. Please help me.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by ncode View Post
    My lecturer just teach us some basic C Pointer. Can someone more briefly explain about & and * in C pointer. I'm kinda confused.

    Here's my though
    1. &a > Refer to the L-value of variable.
    2. *aPtr > Refer to the value of aPtr?<<<<Not very sure. Please help me.
    Think of a post office, with post office boxes:

    &A is the address of the post office where box A is.
    *APtr refers to the contents of mail box APtr, itself.

    A pointer is just like any other variable, and has to have an address. It just also holds a value that is an address, instead of an int, a double, or a char, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 10-30-2009, 04:41 PM
  2. Replies: 9
    Last Post: 06-13-2009, 02:31 AM
  3. Replies: 1
    Last Post: 03-24-2008, 10:16 AM
  4. Replies: 4
    Last Post: 08-27-2007, 11:51 PM
  5. Replies: 6
    Last Post: 11-29-2004, 08:50 AM