edited by
560 views
0 votes
0 votes
give the complete solution with explanation

int main()
{
    int arr [2] [2] [2] = {10,2,3,4,5,6,7,8};
    int *p, *q;
    p = &arr[1] [1] [1];
    q = (int*) arr;
    printf("%d ,%d \n",*p ,*q);
    return 0;

}
edited by

1 Answer

1 votes
1 votes
Ans will be

*p = 8

*q = 10

for clear idea, your array can be seen as

arr[0]            arr[1]

$\begin{bmatrix} 10 & 2\\ 3& 4 \end{bmatrix}$   $\begin{bmatrix} 5 & 6\\ 7& 8 \end{bmatrix}$

Related questions

4 votes
4 votes
1 answer
2
1 votes
1 votes
2 answers
3
Ahsanul Hoque asked Feb 17, 2019
1,325 views
Tell me the difference :&(arr+1) and &arr+1
13 votes
13 votes
8 answers
4
Na462 asked Aug 22, 2018
5,568 views
Consider a 2 dimensional array A[40...95,40...95] in lower triangular matrix representation. The size of each element of array is 1 Byte.If array is implemented in memory...