Question: int i; short int * * array; int row = 2 5 ; int col = 1 0 ; if ( NULL = = (

int i;
short int** array;
int row =25;
int col =10;
if (NULL ==(array =(short int**)malloc(row * sizeof(short int*))))
exit(1);
if (NULL ==(array[0]=(short int**)malloc(row * col* sizeof(short int*))))
exit(1);
for (i =1; i < row; ++i)
array[i]= array[0]+ i * col;
16.This code is used for
A. allocating a 1 dimension contiguous array on the heap
B. allocating a 2 dimension contiguous array on the heap
C. allocating a 2 dimension non-contiguous array on the heap
D. allocating a 3 dimension contiguous array on the heap
E. allocating a 3 dimension non-contiguous array on the heap
17. The total amount of memory required for this array storage is (assume pointers require 8 bytes
each, a short int requires 4 bytes, an int requires 4 bytes and a float requires 4 bytes)
A.500 bytes
B.700 bytes
C.708 bytes
D.1000 bytes
E.1208 bytes

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!