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) 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.
b) Use a for statement to display the elements of built-in array values by subscripting the pointer to the built-in array.
c) 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 point- er/offset notation.
d) What address is referenced by vPtr + 3? What value is stored at that location?
e) Assuming that vPtr points to values[4], what address is referenced by vPtr -= 4? What value is stored at that location?


```
a) for (int i{0}; i < SIZE; ++i) {
cout << setw(4) << *(values + i);
}
b) for (int i{0}; i < SIZE; ++i) {
cout << setw(4) << vPtr[i];
}
c) values[4], *(values + 4), vPtr[4], *(vPtr + 4)
d) The address of the location pertaining to values[3] (i.e., 1002506). 8.
e) The address of where values begins in memory (i.e., 1002500). 2.
```

Computer Science & Information Technology

You might also like to view...

Suppose you want to create a squad array with four Pixie objects. Which definition is correct?

A. new Pixie{} = squad[new Pixie[pixie01... pixie04]; B. Pixie[] squad = new Pixie{pixie = 0; pixie < 5 };  C. new squad[] Pixie = {pixie01, pixie02, pixie03 , pixie04}; D. Pixie[] squad = new Pixie[] {pixie01, pixie02, pixie03 , pixie04};

Computer Science & Information Technology

The file that data is written to is the __________ file.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Give a command line for producing 10 copies of the report file on the hp3 printer. Each page should contain a page header produced by the pr command.

What will be an ideal response?

Computer Science & Information Technology

Describe three common errors that cause a program to work incorrectly.

What will be an ideal response?

Computer Science & Information Technology