Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C language 1.9 Let's examine the pointer version: Observe the first step, where we allocate space for 3 pointers: B2 -Cdouble ** malloc (sizeof (double*3);
C language
1.9
Let's examine the pointer version: Observe the first step, where we allocate space for 3 pointers: B2 -Cdouble ** malloc (sizeof (double*3); Let's tease this apart: First, consider the argument to malloc: B2-Cdouble * malloc (sizeof (double*3); This says that we are requesting 3 contiguous spots where each spot is large enough to hold a pointer-to-a-double B2- double **) malloc (sizeof double*) *3); The retum value from malloc is the address (pointer) to that 3-sized array of double-pointers. . Hence, it is a pointer to a pointer: B2 = (double **) malloc (sizeof(double*) * 3); . Next, we need each row of the 2D array: for Ci-0; iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started