3,566 views
#include <stdio.h>
int main()
{
int a[] = {1, 2, 3, 4, 5, 6};
int (*ptr) = a;
printf("%d %d ", (*ptr), (*ptr));
++ptr;
printf("%d %d\n", (*ptr), (*ptr));
return 0;
}

(a) 2 3 5 6 (b) 2 3 4 5
(c) 4 5 0 0 (d) none of the above

Does the above structure for the 2D array is correct? . Because i was unable to visualise the 2D array structure with rows not mentioned.
two 2-d arrays a and a

in which a---a ,a,a[0 elements are 1,2,3

same as a--a,a,a elements are 4,5,6

int *ptr;

This is an array of 10 int* pointers

int (*ptr);

This is a pointer to an array of 10 int

*(*a+1)   (*a)  are two diffferent representation of a $int (*ptr)$ // is nothing but  ptr[][]

$int (*ptr)=a;$ // it stores address of a .

$(*ptr)$first element  // nothing but a  which print 2
$(*ptr)$ 2nd element. // // nothing but a which print 3

$(++ptr)$ it is  increased .it access 2nd dimensional array

$(*ptr)$ first element  // nothing but a  which print 5
$(*ptr)$  2nd element. // // nothing but a which print 6

Output is $2,3,5,6$

http://stackoverflow.com/questions/13910749/difference-between-ptr10-and-ptr10

Ans should be 2& 3.....5&6 ...just u need to know

(*PTR)[s] can be written as *(*PTR +s)...u will able to solve problem...