Write the c statement that dynamically creates an array of


1. Consider the following statement:

int *num;

a. Write the C++ statement that dynamically creates an array of 10 components of type int and num contains the base address of the array.

b. Write a C++ code that inputs data into the array num from the standard input device.

c. Write a C++ statement that deallocates the memory space of array to which num points.

2. Consider the following C++ code:

int *p;

p = new int[10];

for (int j = 0; j

p[i] = 2 * j - 2;

Write the C++ statement that deallocates the memory space occupied by the array to which p points.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write the c statement that dynamically creates an array of
Reference No:- TGS02253249

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)