C pointer

This is a discussion on C pointer within the C Programming forums, part of the General Programming Boards category; My lecturer just teach us some basic C Pointer. Can someone more briefly explain about & and * in C ...

  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, 05:41 PM
  2. Replies: 9
    Last Post: 06-13-2009, 03:31 AM
  3. Replies: 1
    Last Post: 03-24-2008, 11:16 AM
  4. Replies: 4
    Last Post: 08-28-2007, 12:51 AM
  5. Replies: 6
    Last Post: 11-29-2004, 08:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21