what are the different between a+i and *(a+i)?in a[n][n]

This is a discussion on what are the different between a+i and *(a+i)?in a[n][n] within the C++ Programming forums, part of the General Programming Boards category; when I define a array for example a[n][n], what are the different between a+i and *(a+i)? they are all adress. ...

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

    what are the different between a+i and *(a+i)?in a[n][n]

    when I define a array for example a[n][n],
    what are the different between a+i and *(a+i)?
    they are all adress.
    thank you(I'm a foreigner ,english is bad ^_^)

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    a+i is an address of the (i+1)th array stored in a

    *(a+i) dereferences the first element in the (i+1)th array. It is not an address unless the arrays are storing addresses.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

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