Ask Question
21 August, 14:02

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

+5
Answers (1)
  1. 21 August, 16:13
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers