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.

Rishabh said:   1 decade ago
An another way to represent pointer as array is ?

ptr[0]------>*(ptr+0);
ptr[1]------>*(ptr+1);

Ravitheja said:   1 decade ago
Anil Kumar Kandula.

Thank you very much. Nice eplanation.

Mark said:   1 decade ago
Please, someone clear my doubt.

main()
{
int a[2][2]={1,2,3,4};
printf("%d %d",a+1,*(a+1));
}

In this problem both values of printf are same.. how could it.. if a+1 denotes address of a[1][0], then *(a+1) should display its value, but why not..??? please explain ?

Rajesh said:   1 decade ago
Nice Explanation by ramaji & pradeep.

Sagar said:   1 decade ago
Thanks pradeep

Meenu said:   1 decade ago
Explain this concept.

Ashok said:   1 decade ago
Given: a[i][j][k][l]

i number of rows with
{
each contains j number of rows with
{
each contains k number of rows with
{
EACH CONTAINS l no of columns
}
}
}

Bhuvana said:   1 decade ago
Thanks ramanji.

Kuttu said:   1 decade ago
Thanks anil kumar.

Anil kumar Kandula said:   1 decade ago
a[i] = *(a+i)

a[i][j] = *(a[i]+j)
= *(*(a+i)+j)

a[i][j][k]= *(a[i][j]+k)
= *(*(a[i]+j)+k)
= *(*(*(a+i)+j)+k)


Post your comments here:

Your comments will be displayed after verification.