. .
a. the contents of memory, interpreted in one of
several ways, without the associated variable names
b. the names and values of variables in memory,
interpreted in one of several ways
c. the names and values of variables in memory,
interpreted as 32-bit integers no matter what the
variables' types
d. the contents of memory, interpreted as 32-bit
integers, without the associated variable names
3:Consider the following code fragment.
int a;
int b;
int main(int argc, char *argv[]) {
int c;
int d;
...
/* some code */
}
Which of the following must be true? (B)
a. The value of *d is closer to the value of *c than to
the value of *a.
b. The value of &d is closer to the value of &c than
to the value of &a.
c. The values of *a and *b are closer to each other
than the values of
*c and *d.
d. The values of &a and &b are closer to each other
than the values of &c and &d.
4:Consider the following code.
char a[100];
a[99] = *((char *) (((int) &a[0]) + 4))
If integers are 32 bits wide, which of the following
values is equal to a[99]? ( A )
a. a[4]
b. the integer stored in the bytes a[4], a[5], a[6] and
a[7]
c. a[3]
d. a[0] + 4
5:Which of the following statements about alignment
within C struct's is true? ( D)
. v
I. Alignment may cause the allocation of unused
space.
II. Alignment is required by all modern processors.
III. Alignment can help processors access data more
efficiently.
a. I, II, and III
b. I only
c. II and III
only
d. I and III
only
6:In C, assuming that an int takes 4 bytes, how many
bytes are required
to represent the following array? ( C)
int a[12];
a. 12
b. 52
c. 48
d. 44
7:Given the following declaration and initialization
of s, what is the
value of the expression s[6]? (D)
char s[] = "string";
a. '\n'
b. an unpredictable value
c. 'g'
d. '\0'
8:Given the address of a C struct at runtime, how is
the address of a member element in the struct
determined? (C)
a. A linear search is made from the base address of
the struct.
b. The element name is looked up in a symbol table.
c. A constant offset associated with the member is
added to the address.
d. The struct consists of an array of pointers to the
elements of the struct.
9:In one puter, the bytes with addresses A, A+1,
A+2 and A+3 contain the integer 256, and the
.