Question: C++ code. C++ code. 1. Allocate an array of ten ints on the free store using new. 2. Print the values of the ten ints
C++ code.

C++ code.
1. Allocate an array of ten ints on the free store using new. 2. Print the values of the ten ints to cout. 3. Deallocate the array (using deletel]) 4. Write a fiunetion print array10(ostream& os, int* a) that prints out the values of a (assumed to have ten elements) to OS. 5. Allocate an array often ints on the free store; initialize it with the values 100, 101, 102, etc.; and print out its values. 6. Allocate an array of 11 ints on the free store; initialize with the values 100, 101, 102, etc; and print out its values. 7. Write a function print array(ostream& os, int* a, int n) that prints out the values of a (assumed to have n elements) m& os, int a, int n) that prints out the values of a (assuuned to have n elements) to os. S. Allocate an army of 20 ints on the fic soe: initaliz h the values 100, 101, 102. ete: and print our its valnes 9. Did you remember to delete the arrays? (If not, do it) 10. Do 5, 6, and S using a vector instead of an array and a print vector0 instend of print arrayd
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
