For each of the following, write a single statement that performs the specified task. Assume that floating-point variables number1 and number2 have been declared and that number1 has been ini- tialized to 7.3. Assume that variable ptr is of type 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 number1?
a) double *fPtr;
b) fPtr = &number1;
c) cout << "The value of *fPtr is " << *fPtr << endl;
d) number2 = *fPtr;
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 " << fPtr << endl;
Yes, the value is the same.
You might also like to view...
What is wrong with the following Do loop?
``` Dim index As Integer = 1 Do While index <> 10 lstBox.Items.Add("Hello") index += 2 ``` (A) It should have been written as a Do Until loop. (B) It is an infinite loop. (C) The test variable should not be changed within the loop itself. (D) Nothing
Describe the Windows 8 refresh ability.
What will be an ideal response?
Ellen is an academic writer in an educational firm. The firm gives her a Word document containing topics related to Sociology and asks her to develop content for each topic in another Word document. She keeps swapping between the two documents while preparing the content. Which of the following features is Ellen using to swap between the documents??
A. Multiple Pages button? B. ?Linked Notes button C. ?Switch Windows button D. ?Table of Contents button
A(n) ________is motion applied to text and objects on a slide
A) annotation B) animation C) transition D) simulation