Question: HI PLEASE HELP AND ANSWER IT CORRECTLY THANKS! D Question 1 0.5 pts 1. The & operator is used to dereference a pointer 2. The







D Question 1 0.5 pts 1. The & operator is used to dereference a pointer 2. The operator is the address operator 1. False 2. True 1. True 2. False 1. True 2. True 1. False 2. False D Question 2 0.5 pts A swap function works as follows: It takes in two pointers as arguments. Both pointers point to integers. The values of the two pointers are swapped. For example if num1 is initially 5 and num2 is initially 10, then num1.10 and num2=5 after the swap function has finished executing Question 2 0.5 pts A swap function works as follows: It takes in two pointers as arguments. Both pointers point to integers. The values of the two pointers are swapped. For example if num1 is initially 5 and num2 is initially 10, then num1-10 and num2-5 after the swap function has finished executing. NOTE: Assume the following code is in main: int num1-10, int num2-5; swapl&num1, &num2): Which of the options below is the correct implementation of the swap function? void swaplint *x int *) int temp = nullptr: "temp - x *x=&y. *y&temp: 1 void swapintx int" int template Ovoid swap(int *x int") [ int temp - nullptr; "temp = x y="temp: 1 O void swaplint "x, int") int temp: temp - Exc Ex-&y: y-temp: 1 void swaplintx int") int temp temp = "temp = x *x-"y: 'y = 'temp: 1 void swap(int 'x, int") int temp temp &x *x&y: 'y temp: 1 O vold swaplint x Int'l 1 int temp: temo - x 'y temps Question 3 0.5 pts 1. int x-5, *ptr nullptr: 2. ptr -&x; 3. ptr = 100; // Store 100 in X 4. cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
