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++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 28SA
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning