Hi all;
I've to use a dynamic array(2D) in my program in C.
I've read some tutorials about this and I understood its mental.But still there exist a few points which I didn't understand.
Here is a code:
int main(){
int **a, x;
a = (int **)malloc(sizeof(int) * 10);
for(x = 0; x < 10; x ++) {
a[x] = (int *)malloc(sizeof(int) * 3);
}
/* ... */
for(x = 0; x < 10; x ++) {
free(a[x]);
}
free(a);
Firstly: Does the **a mean that first * points the row and second * points the column???(If not what does it mean???)
Secondly: In the "a[x] = (int *)malloc(sizeof(int) * 3);" , malloc function returns an adress and as far as I can see it assigns a[x] to a[x] 's adress.
But when I print the a[x] value and it's adress; I saw it doesn't process like my idea which was indicated above.So what is the problem???
Thanks for your helps...