C Programming - Pointers - Discussion

Discussion Forum : Pointers - General Questions (Q.No. 6)
6.
What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
((((a+i)+j)+k)+l)
*(*(*(*(a+i)+j)+k)+l)
(((a+i)+j)+k+l)
((a+i)+j+k+l)
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
70 comments Page 6 of 7.

Sakthi said:   1 decade ago
Nice explanation from Ramanji & Pradeep.

Vani said:   1 decade ago
Thank you Ramanji.

Vinoth kannan said:   2 decades ago
This is an another way for writing pointer variable

Raju Naidu said:   1 decade ago
Arrays internally works based on pointers. In arrays each subscript represents one pointer.

Ex:a[1]

Once you compile this code it internally converted into
*(a+1)or*(1+a)

That's y
a[i][j][k][l]---->a[i]--->*(a+i)(one subscript means onepointer)
a[i][j]--->*(*(a+i)+j)(Two subscripts means two pointers)
a[i][j][k]----->*(*(*(a+i)+j)+k)
a[i][j][k][l]---->*(*(*(*(a+i)+j)+k)+l)

Bye friends.

Tj015 said:   2 decades ago
Can anyone explain this concept?

Maxx said:   1 decade ago
Subscript is mainly variable which show an index of a particular member of d array, it is mainly use to access some member of array. Like a[i]...... Here I is a subscript variable. Which will access I the member of the array.

Cherry said:   1 decade ago
@Rishitha
In c language , subscript is used to allocate memory location using index in array

Rishitha said:   1 decade ago
What is subscript?

Mrutyunjay said:   1 decade ago
We can write a[i] in pointer as *(a + i)
similarly a[i][j] as *(*(a+i)+j)
a[i][j][k] as *(*(*(a+i)+j)+k)
a[i][j][k][l] as *(*(*(*(a+i)+j)+k)+l)

Khushi said:   1 decade ago
Thanks raju naidu.

Nice explanation :).


Post your comments here:

Your comments will be displayed after verification.