I need to pass a 2D array into the method below:
int pipeChild_1(int pipedes[], char *argsArray[][]);
But the compiler gives that error:
array has incomplete element type 'char *[]'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately you can’t do that – ‘c’ only knows about pointers not about arrays.
If the size of the array is fixed (or at least the last dimension) you can pass that to the function, but a more common method is to pass a pointer to the array and the dimensions separately
eg Passing multidimensional arrays as function arguments in C or http://c-faq.com/aryptr/pass2dary.html