For each of the following, write a statement that performs the specified task. Assume that dou- ble variables number1 and number2 have been declared and that number1 has been initialized to 7.3.
a) Declare the variable doublePtr to be a pointer to an object of type double and initialize the pointer to nullptr.
b) Assign the address of variable number1 to pointer variable doublePtr.
c) Display the value of the object pointed to by doublePtr.
d) Assign the value of the object pointed to by doublePtr to variable number2.
e) Display the value of number2.
f) Display the address of number1.
g) Display the address stored in doublePtr. Is the address the same as that of number1?
```
a) double* doublePtr{nullptr};
b) doublePtr = &number1;
c) cout << "The value of *fPtr is " << *doublePtr << endl;
d) number2 = *doublePtr;
e) cout << "The value of number2 is " << number2 << endl;
f) cout << "The address of number1 is " << &number1 << endl;
g) cout << "The address stored in fPtr is " << doublePtr << endl;
Yes, the value is the same.
```
You might also like to view...
The ________ function extracts from your data table a single record that matches the conditions you specify
A) DAVERAGE B) DSUM C) DGET D) DCOUNT
A writer is contacted by her executive editor to see whether everything is okay because the copy editor had been sending emails to the writer. The writer responds to the executive editor and tells him that no emails have been received from the copy editor. What is the most likely problem?
A) The copy editor has not clicked on Send and the emails are in the drafts folder. B) Windows Firewall is blocking the copy editor's email provider. C) The email application has quarantined the emails. D) The emails were addressed to another person.
Individual personal computers can be secured through the use of a smart card and the user's PIN number
Indicate whether the statement is true or false
You can click the Documents arrow on the address bar to display a location menu that contains a list of folders in the Documents library.?
Answer the following statement true (T) or false (F)