Give the sequence of steps for creating and using a dynamic array.
What will be an ideal response?
a) define a pointer type for pointers to variables of the type the elements are to be
```
typedef double * doublePtr’
```
b) declare a pointer variable of the defined type to point to the dynamically allocated array.
```
doublePtr a;
```
c) assign to the pointer variable the returned value from a call to new
```
a = new double[arraySize];
```
d) use as you would any array.
```
a[4] = 17.94;
```
e) before the end of the block where the pointer variable is declared, call the delete
operator with the pointer variable as argument. Note the syntax for the deletion of memory allocated as an array.
```
delete [] a;
```
You might also like to view...
Which of the following is a method that optical drive manufacturers have used to increase transfer rates?
A) Increasing RAM on video cards B) Adding buffer memory within the drive C) Minimizing hard drive caching because the CD-ROM is faster D) Reducing allowable colors and resolution for video E) None of these are methods used for this purpose.
The ____ function can be used to test if data entered by the user is numeric.
A. IsInteger B. IsNumber C. IsNumeric D. IsNonAlpha