Ask Question

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

+2
Answers (1)
  1. 14 May, 22:04
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers