char ** argv , contains input that you can provide to your application c. Each argv position will contain a string, a string in c is represented by an array of characters.
So, since you can give more than one argument to your application, this means that you can have more than one row, therefore more than one char array. So char ** argv .
When you do. / your _application 1 10 3. argv has 1 10 3:
argv[0] = "1"; argv[1] = "10"; argv[2] = "3";
Argc will tell you the number of arguments received by your_cell. In this example, argc = 3.
When you know the size, you can do something like this char array [M] , when you donβt know manually the size you make char * array;. Basically saying that a variable array will point to the first memory position of a future array of characters.
You can go deeper, you need to have several lines, so you can make a char array [N] [M] , or if you don't know the size of the char ** array . On the same line, the first pointer points to the first position of the memory of the character array and the second pointer to char of the first character array.
Why is ** argv pointing to the first char, and not to the whole line?
Because argv is an array of character arrays, so the first point already points to the first character array, so the second pointer points to the first char of this array. So * argv [0] , the same one, because the pointer points to an array of characters, and you specify the position you need, in this case it is zero, so this will be the first char from the array that you are pointing to.
You can also specify the char array that you want to do something like argv [1] [0] , in which case you are pointing to the first char of the second array,
The 2D array is sequentially allocated in memory, so ** argv points to the first position of the 2D array, because you need to know where the 2D arrays will run.
After 2D is selected in memory, you can know that you can directly specify the position you want to access, for example, 2D_array [1] [3] ;