Thread: Unsolvable fact in multi-dimensional arrays

  1. #1
    Unregistered
    Guest

    Unsolvable fact in multi-dimensional arrays

    Hello everybody. as you all know that declaring as
    int arr[3][2][5];
    actually means that arr is pointer to first two dimensional array &
    arr is pointer to pointer to first one dimensional array &
    arr is pointer to pointer to pointer first element

    Here is my doubt:
    writing *(arr+0) is I two dim. array and *(*(arr+0)) is I one dim. array and writing *(*(*(arr+0))) is the first element. SO WHAT DOES 'arr' CONTAINS
    In the previous example (i) is 'arr' contains the address of arr[0][2][5] or
    (ii) is 'arr' contains the address of a pointer which contains address of arr[0][0][5] or (iii) is 'arr' contains the address of a pointer which contains the address of arr[0][0][0]. SO WHAT IS THE NATURE OF 'arr'. Can anybody help me

    again the same "by sridhar, au,chennai,india"

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    101
    Hello everybody. as you all know that declaring as
    int arr[3][2][5];
    actually means that arr is pointer to first two dimensional array &
    arr is pointer to pointer to first one dimensional array &
    arr is pointer to pointer to pointer first element
    Don't confuse an array with a pointer. See: http://www.eskimo.com/~scs/C-faq/q6.2.html and http://www.eskimo.com/~scs/C-faq/q6.18.html
    - lmov

  3. #3
    SRIDHAR
    Guest

    Smile Re: Unsolvable fact in multi-dimensional arrays

    Thanks a lot imov

    can you see my next thread

    * controlling non-dos programs

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multi dimensional array
    By $l4xklynx in forum C Programming
    Replies: 7
    Last Post: 01-03-2009, 03:56 AM
  2. Have you ever had a four dimensional experience
    By Silvercord in forum A Brief History of Cprogramming.com
    Replies: 35
    Last Post: 08-18-2003, 06:13 PM
  3. Passing 2 dimensional Arrays to functions
    By aresashura in forum C++ Programming
    Replies: 4
    Last Post: 12-18-2001, 12:59 AM
  4. Two dimensional arrays
    By Jax in forum C Programming
    Replies: 1
    Last Post: 11-07-2001, 12:53 PM