For each of the following, write a single statement that performs the specified task. Assume that floating-point
Fantastic news! We've Found the answer you've been seeking!
Question:
For each of the following, write a single statement that performs the specified task. Assume that floating-point variables number1 and number2 have been declared and that number1 has been initialized to 7.3.
- Declare the variable fPtr to be a pointer to an object of type double and initialize the pointer to nullptr.
- Assign the address of variable number1 to pointer variable fPtr.
- Display the value of the object pointed to by fPtr.
- Assign the value of the object pointed to by fPtr to variable number2.
- Display the value of number2.
- Display the address of number1.
- Display the address stored in fPtr. Is the address displayed the same as that of number1?
- Display the address of the pointer fPtr.
- Store the sum of number1 and number2 to the location pointed to by fPtr.
- Declare the variable fPtrTemp to be a pointer to an object of type double and initialize it fPtr.
Related Book For
Posted Date: