For each of the following, write a single statement that performs the specified task. Assume that long variables value1 and value2 have been declared and value1 has been initialized to 200000.
a) Declare the variable longPtr to be a pointer to an object of type long.
b) Assign the address of variable value1 to pointer variable longPtr.
c) Print the value of the object pointed to by longPtr.
d) Assign the value of the object pointed to by longPtr to variable value2.
e) Print the value of value2.
f) Print the address of value1.
g) Print the address stored in longPtr. Is the value printed the same as value1’s address?
a) long *longPtr;
b) longPtr = &value1;
c) cout << *longPtr << '\n';
d) value2 = *longPtr;
e) cout << value2 << '\n';
f) cout << &value1 << '\n';
g) cout << longPtr << '\n'; yes.
You might also like to view...
When creating a range name from a selection for a HLOOKUP function, you should choose the names based upon the:
A) top row. B) bottom row. C) right column. D) left column.
You have been asked to identify a service on AWS that is a durable key value store. Which of the services below meets this definition?
A. Mobile Hub B. Kinesis C. Simple Storage Service (S3) D. Elastic File Service (EFS)