6. Write a swap function, that swaps the values of two variables in main, but use pointers instead of reference parameters. 7. Write a function that takes an array of ints and its size as arguments. It should create a new array that is the same size as the argument. It should set the values in the new array by adding 10 to each element in the original array. The function should return a pointer to the new array. (Make sure you use dynamic memory allocation)   can i get answers for this two sub parts. thanks

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.4: Arrays As Arguments
Problem 5E
icon
Related questions
Question

6. Write a swap function, that swaps the values of two variables in main, but use
pointers instead of reference parameters.
7. Write a function that takes an array of ints and its size as arguments. It should
create a new array that is the same size as the argument. It should set the values in
the new array by adding 10 to each element in the original array. The function
should return a pointer to the new array. (Make sure you use dynamic memory
allocation)

 

can i get answers for this two sub parts. thanks

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning