Your program creates a dynamically allocated array as follow
Your program creates a dynamically allocated array as follows:
int *entry;
entry = new int[10];
so that the pointer variable entry is pointing to the dynamically allocated array. Write code to fill this array with 10 numbers typed in at the keyboard.
Solution
#include <iostream>
using namespace std;
int main()
{
int * entry;
entry = new int [10];
int array_size = 10;
int num;
for(int i = 0; i< array_size; i++)
entry[i] = i;
for(int i = 0; i < array_size; i++)
{
cout << \"Enter an int into the array: \" << endl;
cin << entry[i] << endl;
}
return 0;
}
![Your program creates a dynamically allocated array as follows: int *entry; entry = new int[10]; so that the pointer variable entry is pointing to the dynamicall Your program creates a dynamically allocated array as follows: int *entry; entry = new int[10]; so that the pointer variable entry is pointing to the dynamicall](/WebImages/16/your-program-creates-a-dynamically-allocated-array-as-follow-1028948-1761533040-0.webp)