harlem1619 harlem1619
  • 14-09-2019
  • Computers and Technology
contestada

Dеclarе and allocatе mеmory (on thе hеap) for a two-dimеnsional array of strings namеd carMakеs with 20 rows, еach with 6 columns

Respuesta :

ExieFansler ExieFansler
  • 23-09-2019

Answer:

string ** carMakes=new string*[20];  

   for(int i=0;i<20;i++)

   {

       carMakes[i]=new string[6];

   }

Explanation:

The above written piece of code is in C++ and it will declare and allocate memory on the heap for a 2-D array of strings with the number of rows 20 and number of columns 6 with name of the array carMakes.

To declare a 2-D array in C++ we use new keyword.

Answer Link

Otras preguntas

The initial reaction of the body to stress is called ?
What is the state of matter of mantle??
Of the 95 people enrolled in mathematics class, 93% are present. How many are present?
what is one eighth divided by two fourths
Y - 4 = 2.5(x+3) write an equation in slope intercept form
The fact that water is a _________ molecule is important, because this allows it to dissolve many substances.
How do people transport/move ideas in Greece?
Iron has a density of 7.86 g/cm3. calculate the volume (in dl) of a piece of iron having a mass of 4.15 kg . note that the density is provided in different unit
Potassium carbonate dissolved in water
Tiffany is 34 years old and Vanessa is 6 years old. How many years will it take until Tiffany is only 3 times as old as Vanessa?