Thread: c programming

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    1

    c programming

    how can i different the *pointer and the "*content of" in the program

  2. #2
    Unregistered
    Guest
    You need better english.

  3. #3
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    how can i different the *pointer and the "*content of" in the program
    How can I tell the difference between the uses of * in a program.
    My translation correct?

    When you declare a pointer, the * specifies that it is of type pointer. You will normally find them during declarations or as parameters in function calls.
    example
    int *ptr;

    ptr now contains the address of whatever it points to.

    To get the value or content of the thing it's pointing at, you use dereference the pointer using *. You will normally see this during your main portion of your code and not during declarations.
    example:
    ptr = &i; // (*ptr gives you the value of i)
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

Popular pages Recent additions subscribe to a feed