C Programming - Pointers - Discussion

Discussion Forum : Pointers - Point Out Correct Statements (Q.No. 6)
6.
Which of the statements is correct about the program?
#include<stdio.h>

int main()
{
    int arr[3][3] = {1, 2, 3, 4};
    printf("%d\n", *(*(*(arr))));
    return 0;
}
Output: Garbage value
Output: 1
Output: 3
Error: Invalid indirection
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
27 comments Page 3 of 3.

Mini said:   1 decade ago
Thanks Wikiok

Nora said:   1 decade ago
Thanks Wikiok

Swapnil said:   1 decade ago
Thanks Wikiok.

Vijay said:   1 decade ago
@Wikiok.

Hai you said very well.

Wikiok said:   1 decade ago
Error: ***arr == arr[0][0][0], but arr has only 2 dimension.

Sang said:   1 decade ago
How to told error is found ?

TNS said:   1 decade ago
The given array is a 2-D array, so we can access all the elements using double pointer. Triple pointer is not needed.


Post your comments here:

Your comments will be displayed after verification.