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]
Discussion:
70 comments Page 1 of 7.
Tj015 said:
2 decades ago
Can anyone explain this concept?
Vinoth kannan said:
2 decades ago
This is an another way for writing pointer variable
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)
Vani said:
1 decade ago
Thank you Ramanji.
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.
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)
Sakthi said:
1 decade ago
Nice explanation from Ramanji & Pradeep.
Swati bhatt said:
1 decade ago
Thanks to both of you for your good explation, even I know this ans but not clearly.
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.
Guru said:
1 decade ago
Thank you raman and pradeep.
Its nice explanation.
Its nice explanation.
Srivibha said:
1 decade ago
Why we are getting same value when we are printing *(a) and *(*(a))?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers