Question: Exercise 4 The size of array is not necessary to be constant. If u want to set the size manually, u can use Dynamic Memory

 Exercise 4 The size of array is not necessary to be

Exercise 4 The size of array is not necessary to be constant. If u want to set the size manually, u can use Dynamic Memory Allocation" ( (type)malloc(sizeof(.....))). Those codes down below has bug. Plz modify the program so that the arrays size can be set manually (such that this program can be run successfully . (Hint: use pointer) Enter size of a one-dimensional array: 6 Enter number of rows and columns in a 2-D array: 25 Enter number of rows and columns in another 2-D array: 4 3 sizeof(array) yields array size of 24 bytes One-dimensional array: array[0] = 0 array[1] = 1 array[2] = 4 array[3] = 9 array[4] = 16 array[5] - 25 First two-dimensional array: 1 2 3 4 3 4 5 Second two-dimensional array: 0 1 2 23 2 3 4 3 4 5

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!