Ask Question
9 January, 16:15

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

+1
Answers (1)
  1. 9 January, 16:32
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers