Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Please!!! 22.2 Reverse array copy One of the annoying things about arrays is copying one to another. While you could do it with memcpy,
C++ Please!!!
22.2 Reverse array copy One of the annoying things about arrays is copying one to another. While you could do it with memcpy, the safer thing too do is to copy it item by item. Here you'll copy one array to another...but in reverse. Create a function called reverseArrayCopy, following this definition: void reverseArrayCopy(int original [], int originalSize, int newVersion [], int newVersionSize); You also need to update main() to create an array to copy into (make it size 5, like the original I'm giving you), then call reverseArrayCopy with both arrays. Your output (from main()) should be the reversed array. So if the input is 1 2 3 4 5 the output should be 5 4 3 2 1 (Go ahead and put a space after the last number to make your coding easier.) NOTE: unit tests will be used to check the proper working of your function. Do not assume that the sizes provided to reverseArrayCopy ( ) are always 5. NOTE 2: Be sure to check for a newVersion Size that's smaller than originalSize! If newVersionSize is smaller, just return from the function without copying anything. 346430.2101388.qx3zqy7
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started