Question: in C++ Write a user-defined function to swap values of two int dynamic variables. Please write the function definition (function heading, function body) in the
in C++
Write a user-defined function to swap values of two int dynamic variables. Please write the function definition (function heading, function body) in the Answer area. No need to provide the entire program, meaning, no need to put main() here. (Try to preserve the indentation format of your code. You may cut and paste the code into MS Word then copy over to the Answer area.) You may use the following test scenario to test your function. int main() { int* a = new int, *b = new int; *a = 10, *b = 20; // Create a user-defined function that swaps the values of two dynamic variables of int data type. // After making the function call, in this case, *a should be 20, and *b should be 10. return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
