In C, what do you call a collection of values of the same type?
Array
What is the name of the converter from a high level language to assembly?
Compiler proper
What is each segment of the memory layout of a process in order?
Text, data, BSS, heap, stack
When including a header file, when do you use <>s vs “”s?
Standard library vs your own file
Is Java a high or low level language? What about C?
Both HHL
In C, what do you call a collection of values of possibly different types?
Struct
What is the name of the converter from assembly to machine code?
Assembler
Which of the variables in the following program are stored on the stack?
What is the size of an int (on the CS machines)?
4 bytes
How should you order the data members in a struct to minimize the size of the struct?
In order from largest to smallest
What do you call the last character of a string?
The null terminator / null byte
What is the name of the type specifier that allows local variables to retain their value between function runs?
static
Which of the following variables are stored in the data segment?
b, i
If you declare a local variable int with the static keyword, but do not initialize it, what will its value be? What if it's not static?
0. Indeterminate.
Which of the following lines of code fail to compile?
4 & 5
What do you call it when a variable disappears automatically when it is no longer needed?
Automatic duration
What is the name of the type specifier that makes global variables local to the file they are in?
static
Which of the following variables are stored in the BSS segment?
a, c, h, j
Can you create an array in a function, and then return it?
Yes, but it will be undefined behavior
What is it called when in memory, a 2d array is stored with each row together?
Row major
What do you call the preprocessor pattern that prevents a header file from being included multiple times?
Include guard
What is the more concise way to write (*myStructurePointer).attribute?
myStructurePointer->attribute
In the program, what will be stored in the text region, and what will be stored in the heap region?
The compiled code (machine code instructions) will be in the text region, and nothing in this program will be in the heap.
What are the rules of struct alignment?
Each member’s address must be a multiple of its size, and the total size must be a multiple of 8
What is Miles’s preference for writing pointers? int *p, int * p, int* p, or int*p?
int* ptr