Question: The following code creates an array of two int pointers. It then makes those int pointers point to int arrays: int * intArrays [ 2

The following code creates an array of two int pointers. It then makes those int pointers point to int arrays:
int* intArrays[2];
intArrays[0]= new int[3];
intArrays[1]= new int[4];
a) Write code that assigns -11,3, and 9 into the array allocated at intArrays[0] and assigns 12,-3,47, and 777 into the array allocated at intArrays[1]
b) Assume your code from part a) is working and has populated the arrays with data. Given these function calls:
printArray(intArrays[0],3);
printArray(intArrays[1],4);
Write the function printArray so it outputs:
-1139
12-347777

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 Programming Questions!