For each of the following write a statement that performs


Question: For each of the following, write a statement that performs the indicated task. Assume that floating-point variables number1 and number2 are defined and that number1 is initialized to 7.3.

a) Define the variable fPtr to be a pointer to an object of type float.

b) Assign the address of variable number1 to pointer variable fPtr.

c) Print the value of the object pointed to by fPtr.

d) Assign the value of the object pointed to by fPtr to variable number2.

e) Print the value of number2.

f) Print the address of number1. Use the %p conversion specifier.

g) Print the address stored in fPtr. Use the %p conversion specifier. Is the value printed the same as the address of number1?

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: For each of the following write a statement that performs
Reference No:- TGS02404116

Now Priced at $15 (50% Discount)

Recommended (94%)

Rated (4.6/5)