Declaring 1-d and 2-d arrays in the new function after they are passed from main function

hey! i can’t understand the difference b/w the way we are declaring 1-d array and 2-d array in called function after they are passed from the main() function:for ex:
void function_name(char*a)

while the 2-d array is declared as :
void function_name(char a[][])

Basically,i cant understand why we are using a star with 1-d array and not 2-d array??

Hello @himanshuep32,

  1. The following statement will cause an error:
    void function_name(char a[][])
    Reason:
    You have to specify the number of columns in the above declaration.

    Note:
    You can skip specifying the rows of an array(i.e. the size of first dimension) but have to explicitly specify the other dimensions.

  2. You can also use the “*” i.e. a pointer for 2D arrays:
    void function_name(char **a)

Hope, this would help.
If you still have issues, feel free to ask.
Give a like, if you are satisfied.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.