Complete Solutions
(2) A pointer is a variable that stores what type of information?
Correct Answer an address
(2) What is the output of an assembler? Correct Answer
relocatable object
(2) Which stage of compilation handles statements like #include
<stdio.h>? Correct Answer preprocessing
(2) Which stage of compilation produces object files as output?
Correct Answer assembling
(2) Which stage(s) of compilation will occur by executing gcc -c
code.c? Correct Answer preprocessing,
compiling,
assembling
(3) A pointer is a variable that stores what type of information?
Correct Answer an address
#define MAX_TITLE_LEN 32
typedef struct novel {
char title[MAX_TITLE_LEN];
int year;
} novel_t;
Assuming that the 'int' type must be at least four bytes, what is
the minimum amount of space required to store a novel_t
, variable? Specify your answer as an exact numerical byte count.
Correct Answer 36
#define MAX_TITLE_LEN 32
typedef struct novel {
char title[MAX_TITLE_LEN];
int year;
} novel_t;
Finish the following function that will print a list of titles of
novels in a given array novels that were published before the
given year:
void print_published_before ( novel_t novels , size_t
num_novels , int year)
{
for ( size_t i = 0; i < num_novels; i++)
if ( [BLANK 1] < year)
{
novel_t *n = novels;
printf( "%s\n", [BLANK 2] );
}
} Correct Answer 1. novels[i].year
2. n->title
A pointer is a variable that stores what type of information?
Correct Answer an address
Applications are forbidden from reading from and writing to
what part of virtual memory? Correct Answer kernel