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) Display the value of the object pointed to by longPtr.
d) Assign the value of the object pointed to by longPtr to variable value2.
e) Display the value of value2.
f) Display the address of value1.
g) Display the address stored in longPtr. Is the address displayed the same as value1’s?

```
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.
```

Computer Science & Information Technology

You might also like to view...

Security policies in Windows are used to enforce password policies. Which of the following password settings are not configured in Account Policies > Password Policy?

a. Minimum password length. b. Change passwords periodically. c. Require complex passwords. d. Prevent old passwords from being reused continually.

Computer Science & Information Technology

Use the Task 3 example to create a PERT/CPM chart.

What will be an ideal response?

Computer Science & Information Technology