176k views
4 votes
When creating a multi-dimensional array dynamically in C/C++ the Memory Manager will go to great pains to make sure the array is completely contiguous with each row followed immediately by another row in the array. The goal is to keep all the data together in memory rather than "wherever it fits." A. True B. False

User Anpan
by
3.5k points

1 Answer

0 votes

Answer:

Here the statement is false.

Step-by-step explanation:

In C/C++, we can define multidimensional arrays in simple words as an array of arrays. Data in multidimensional arrays are stored in tabular form (in row-major order).

General form of declaring N-dimensional arrays:

data_type array_name[size1][size2]....[sizeN];

data_type: Type of data to be stored in the array.

Here data_type is valid C/C++ data type

array_name: Name of the array

size1, size2,... ,sizeN: Sizes of the dimensions.

Foe example:

Two dimensional array:

int two_d[10][20];

Three dimensional array:

int three_d[10][20][30];

User Jcarpio
by
3.7k points