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

Who was the 24 president of the United States?
Carmen is at a used bookstore. Paperback books cost $ 1 each, and hardcover books cost $ 2 each. Carmen can spend up to $ 10 in all.A. Write an inequality that
2x + y = 3 x - 2y = -1 If equation one is multiplied by 2 and then the equations are added, the result is _____.
if x is the principle square root of 7, what must be true.
Describe an example of a fossil that consists of an entire organism
I really need help on geometry
what is 6 times 2/3 (two thirds)?
President Woodrow Wilson's statement "The world must be made safe for democracy" was made to justify his decision toa. end United States imperialism in Latin Am
I really need help on geometry
I am a number less than 3,000.when you divide me by 32,my remainder is 30.when you divide me by 58   ,my remainder is 44.What number am I?