Guys, i have 2 doubts
Doubt-1
--------
int* p[10];
Does it mean that
1)I have an array of 10 pointers, that means, each of them is capable of holding an address OR
2)I have a single pointer that points to an array holding 10 integers
I too, feel , the first is correct, after all, since an array is contiguous memory locations, it doesnt matter whether ur array is of 10-integers or 1000 integers. But in many places, i saw the opposite.
Ok, just in case, the answer happens to be 1 itself, then please tell me whether a concept like 2 exists and when do we need it.
Doubt-2
--------
My doubt arose, cuz when i did
int* p;
int* q;
p=q;
(assume q was holding some address ), it worked
But when i did,
int* a[10];
a[0]=q;
(assume q was holding some address ), it DOESNT WORK
Why Why Why ???? a[0] is also a pointer right ? which means a[0] is also capable of holding the address of an int right ?