c programming

This is a discussion on c programming within the C Programming forums, part of the General Programming Boards category; how can i different the *pointer and the "*content of" in the program...

  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

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