1 1 vote main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); } Puzzles programming-in-c output pointers + – Desert_Warrior 3.7k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 3 3 votes The name arr2D refers to the beginning of all the 3 arrays containing 3 integer each. *arr2D refers to the start of the first 1D array (of 3 integers) that is the same address as arr2D. So the expression (arr2D == *arr2D) is true (1). Similarly, *arr2D is nothing but *(arr2D + 0). Again arr2D[0] is the another way of writing *(arr2D + 0). So the expression (*(arr2D + 0) == arr2D[0]) is true (1). Ans- 1 && 1 = 1 vijaycs answered May 15, 2016 • selected May 16, 2016 by srestha vijaycs comment Share Follow See all 5 Comments 5 5 Comments reply Show 2 previous comments Abhinandan Sharma commented Jun 8, 2016 reply Follow flag how is this expression (arr2D == *arr2D) true arr2D gives the base address of the array whereas *arr2D gives the value at the base address since we can write it as *(arr2D+0) 0 0 replyShare cse23 commented Jul 20, 2016 reply Follow flag 1st statement should be false.. arr2D is an address( we know array name is mnemonic for address, here it represent base address) and *aar2D is a pointer to array because of deferencing it will contain value inside the address...so both should not be equal ryt??? 0 0 replyShare Salazar commented Jan 22, 2018 reply Follow flag arr2D contains address *arr2D points first elem location's singledim sub array so both are same 0 0 replyShare Please log in or register to add a comment.