Write a function that accepts an int array and the array’s size as arguments.
The function should create a new array that is twice the size of the argument array.
The function should copy the contents of the argument array to the new array, and initialize the unused elements of the second array with 0.
The function should return a pointer to the new array.
Demonstrate your function in a program by initializing an array in main and passing it and it's size to your function. Use the pointer returned by your function to print the contents of the array in main. Don't forget to delete the array at the end of main using the pointer.
Your function should not interact with the user in any way (no cin or cout statements).
Do not use global variables.
Your function must use dynamic memory allocation to create the array. If it does not, you will receive 0 points for the assignment.
Do not use smart pointers.
12 freelancers are bidding on average $13 for this job
Hello,I will do simplest coding in C++,C using OOP,data structures [login to view URL] it is an assignment then coding will be easily understandable for u.I have done many C++ works [login to view URL] have a chat. Thanks.
I have 15+ years of experince in C and C++ programming and have handled multiple projects in similar field. I can help you with your work. Please ping me more details so we can work on this
Hi, I'm an expert C++ developer and have hands-on experience working on various data structure/algorithm projects. Let me know further details. Regards, Teja
hey I am expert in that and luckily I have already done this a few months back just give me an opportunity and see [login to view URL] for your reply.