Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hi, glad to hear you're new to C and trying to understand new concepts. Shortly, this is what we call a dynamic 2D array, in C an array is a pointer (in this case array of ints so it's a pointer on an int).
Therefore, if you would like to create a 1D array you'll need to create a pointer on the datatype you want (in this case int), and then allocates memory for it.
But since this is a 2D array you'll need to create a pointer on pointer (which is the double pointer you mentionned) and then for every element of the 2D array you'll need to allocate another array since you want a 2D, because if we can say that a 2D array is a 1D array inside of another one,
I hope I made some things clear hear, it's a very complex concept since it works with pointers but there you have it (you can also type dynamic 2D array in C on Google if you need clearer idea).
This comment is hidden because it contains spoiler information about the solution
It is not.
This comment is hidden because it contains spoiler information about the solution
Hello, i was wondering why did you put this string
tab[i]=(int*)malloc(n*sizeof(int));
in your first for loop? And why did you declare the tab variable as a double pointer?
I'm still new to C and i need to understand some concepts about this language
Oh, now i get it. Thank you
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution