0

how to use array and pointer

2nd Oct 2016, 5:40 PM
faisal
2 Answers
+ 1
first u have to point the address of first block of array (eg . int *p,a[5]; p=&a[0]; ) after that u can access the add. or value of any block. by using: a[i]=*(p+i) and &a[i]=p+i
3rd Oct 2016, 1:40 AM
Shani
Shani - avatar
0
array[1] is equivalent of *(array + 1). So we could say that for arrays pointer is kind of "syntactic sugar" (meaning that is a kind of shortcut)
2nd Oct 2016, 8:25 PM
Artur Dębkowski
Artur Dębkowski - avatar