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

Have an assignment about how many atoms are in a roll of reynold heavy duty aluminum foil. I am not sure how to start?!
What major contribution did chadwick help towards the development of the atom?
PLEASE I NEED THE CORRECT ANSWER !!!
1. The process by which one group takes on the cultural and other traits of a larger group is called _______. assimilation pluralism culture integration 2. Chin
PLEASE I NEED THE CORRECT ANSWER !!!
Which type of star would most likely turn into a black hole if it pulled in mass from a comparison star?
Using the information given, you have to prove the statement they ask you to.
What are hormones and why are they important??
During what years did the french and indian war take place
A girl on a motorbike passes by at a speed of 15 m/ sec. her mass is 40 kg. what is her kinetic energy