Question: a) Declare an integer pointer. b) Use the integer pointer to allocate a dynamic array of 30 integers. c) Given the following: double *dp, *dq;
a) Declare an integer pointer. b) Use the integer pointer to allocate a dynamic array of 30 integers. c) Given the following: double *dp, *dq; double x = 78.9; double y = 23.4; dp = &x; dq = &y; i. What is the value of *dp? ii. Write the C++ code that will swap the values of x and y, WITHOUT USING x and y in your code. iii. Given the following code, write an expression that uses b to copy the third element of the array to the fourth element. DO NOT use a in your answer. float a[5] = {0.0, 1.1, 2.2, 3.3, 4.4}; float *b = &a [1]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
