Question: 3460:209 Assignment 9-B Assignment9-B: The Element Shifter The purpose of this assignment is to help gauge your skills in writing small programs that involve pointers.

3460:209 Assignment 9-B Assignment9-B: The Element Shifter The purpose of this assignment is to help gauge your skills in writing small programs that involve pointers. The program also contains functions and may perform input, output, files and file processing, use arrays and vectors and/or c-string/string arrays, flow of control, and/or calculations. PROGRAM SPECIFICATION For this program, we are going to expand a standard array by dynamically allocating a new one with a larger footprint. The program will use a function that accepts an integer array and the size of the integer array, and then increases it to hold one more item. It shifts all of the original array's values over by one into the new dynamic array, and sets the first element to the value of zero. When the creation and move are complete, this function returns a (smart) unique pointer pointing to the new dynamic array back to the calling program (main). The program will use the declarations for the array and pointer (in main) as follows: const int SIZE 5 int myNumbers [SIZE] = {18, 27, 3, 14, 95); // Define a unique ptr smart pointer, pointing // to a dynamically allocated azray of integers // A unique.Ptr is a small, fast, move-only smart // pointer usually used for managing resources // with exclusive ownership semantics unique_ptr
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
