C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 8.8E

(Write C++ Statements) For each of the following, write C++ statements that perform the
specified task. Assume that unsigned integers are stored in four bytes and that the starting address of the built-in array is at location 1002500 in memory.
a) Declare an unsigned int built-in array values with five elements initialized to the even integers from 2 to 10. Assume that the constant size has been defined as 5.
b) Declare a pointer vPtr that points to an object of type unsigned int.
c) Use a for Statement to display the elements of built-in array values using array sub-Script notation.
d) Write two separate statements that assign the starting address of built-in array values to pointer variable vPtr.
e) Use a for statement to display the elements of built-in array values using pointer/offset notation.
f) Use a for statement to display the elements of built-in array values using pointer/offset notation with the built-in array's name as the pointer.
g) Use a for statement to display the elements of built-in array values by subscripting the pointer to the built-in array.
h) Refer to the fifth element of values using array subscript notation, pointer/offset notation with the built-in array name's as the pointer, pointer subscript notation and pointer/offset notation.
i) What address is referenced by vPtr + 3? What value is stored at that location?
j) Assuming that vPtr points to values [4], what address is referenced by vPtr - = 4? What value is stored at that location?

Blurred answer
Students have asked these similar questions
use C++
State whether the following are true or false. If false, explain why. a) Two pointers that point to different arrays cannot be compared meaningfully.
Write C++ statements to do the following:i.Declare an empty array DATA to hold 7 double floating values.ii.Assign value 5.7 to the last element in the array.iii.Display the sum of the first two elements without using extra memory variable.iv.Write a while-loop that computes the sum of all elements in the array.v.Write a while-loop that finds the minimum element in the array.vi.Randomly generate an index and display the element at this (randomly generated) index in the array.vii.Use an array initializer to declare another array with initial values 5.78, 12.69, 10.45, and19.0
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
1.1 Arrays in Data Structure | Declaration, Initialization, Memory representation; Author: Jenny's lectures CS/IT NET&JRF;https://www.youtube.com/watch?v=AT14lCXuMKI;License: Standard YouTube License, CC-BY
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License