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 7 of 7.

Srivibha said:   1 decade ago
Why we are getting same value when we are printing *(a) and *(*(a))?

Guru said:   1 decade ago
Thank you raman and pradeep.

Its nice explanation.

Harsha said:   1 decade ago
Actually in array concept pointer with create automatically know? Then why should we represent them symbolically? According to this option A is also right na.

Swati bhatt said:   1 decade ago
Thanks to both of you for your good explation, even I know this ans but not clearly.

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

Pradeep said:   1 decade ago
ptr[0]------>*(ptr+0);
ptr[1]------>*(ptr+1);

Like that:

a[i]---->*(a+i);
a[i][j]---->*(*(a+i)+j);
a[i][j][k]---->*(*(*(a+i)+j)+k);

Now you can understand.
(3)

Vani said:   1 decade ago
Thank you Ramanji.

Ramanaji said:   1 decade ago
If we want to refer one dimensional we just use single pointer ie like *p, if we need to refer two dimensional we have to use double pointer reference ie *(*p),,if we have to refer 4 at a time just use 4 pointer statement i.e. *(*(*(*(p))))and so on.....
(2)

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

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


Post your comments here:

Your comments will be displayed after verification.