Thread: Array Address

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    Hyderabad
    Posts
    17
    Rep Power
    0

    Array Address


    Hai all.

    I want clarification about array address

    just follow the example

    void main()
    {
    int temp[10];
    printf("%u",temp);
    printf("%u",&temp);
    }

    in the above program lets say array address is 1000
    then the two printfs returning the same address ( 1000 ).

    Is there any reason?

    Arrayname itself is the address of the array.
    when i am doing &temp , it should get the address of the temp which holding the address of the array

    same thing happening when i am refering Fuction addresses
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    That's because in C, when you're dealing with arrays, temp is a synonym for &temp[0].

IMN logo majestic logo threadwatch logo seochat tools logo