Question
1. For each of the following, write a single c++ statement that performs the specified task. Assume that floating-point variables number1 and number2 have been
1. For each of the following, write a single c++ 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. Assume that variable ptr is a type
of char *. Assume that arrays s1 and s2 are each 100-element char arrays that are
initialized with string literals.
a) Declare the variable fPtr to be a pointer to an object of type double.
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.
g) Print the address stored in fPtr. Is the value printed the same as the address of
number2?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started