Suppose you have the following array declaration in a program.

```
int yourArray[5];
```
\Further suppose that in the implementation of C++ you are using an int that requires
4 bytes.
i) When your program runs, how much memory is required for this array?
ii) Suppose further that your array starts at memory location decimal 100. What will be the address of yourArray[3]?
iii)If you wrote to the (illegal) index 7 position in yourArray to what address would
this clobber?
a) i) The array takes 5 bytes,
```
ii) yourArray[3]
```will be anlocated at Address
103. iii) writing to yourArray[7] will clobber an int starting at location 107.
b) i) The array takes 10 bytes, ii)
```
yourArray[3]
```will be an int located at
Address 106. iii) writing to yourArray[7] will clobber an int starting at
location 114
c) i) The array takes 20 bytes, ii)
```
yourArray[3]
```
will be an int located at
Address 112 iii) writing to
```
yourArray[7]
```will clobber an int starting at
location 128
d) The purpose of a high level language is to insulate the programmer from these
details. It isn’t possible to know this without probing the source to the operating
system and the compiler, or extensive debugging.


c) is correct.

Computer Science & Information Technology

You might also like to view...

In a relational database, a ________ exists between two tables when a record in one table is related to a single record in a second table

A) some-to-some B) many-to-many C) one-to-many D) one-to-one

Computer Science & Information Technology

Multiply the following fractions.

1. (5/6) * (3/7) = (5 * 3) /(6* 7) = 15 / 42 2. (2/3) * (4/3) =(2 *4)1(3 * 3) 3. (4/7) * (2/5) --=(4 *2)/(7 *5) 4. (5/9) * (3/4) =(3*5)1(9*4) = 15 36 5. (7/9) * (2/3) = (7 * 2) (9 * 3)

Computer Science & Information Technology

Match the following terms to their meanings:

I. Chart II. Data point III. Data series IV. Category label V. Column chart A. displays data comparisons vertically in columns B. group of related data points C. numeric value that describes a single value on a chart D. visual representation of numerical data E. text that describes a collection of data points in a chart

Computer Science & Information Technology

____ is an open source language developed at Google.

FORTRAN Visual Basic F# Go

Computer Science & Information Technology