Question: I am trying to return a 2D array in C , but I am having a hard time. Here is my code: char** createArray() {

I am trying to return a 2D array in C, but I am having a hard time.

Here is my code:

char** createArray()

{

//fill array with random data(more concerned about how to return)

char** answer = new int*[10];

return answer;

}

int main()

{

char **answer;

answer = createArray();

return(0);

}

Thanks.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!