ANSWERS GRADED A+
✔✔++ and -- - ✔✔can be applied to structures (ex. ++pt->hours
(pt++)->hours
(++pt)->hours )
✔✔Union definiton - ✔✔is a data type that reserves the same area in memory for two or
more variables, only one at a time though, reserves sufficient memory locations to
accommodate its largest member's data type
✔✔Union layout - ✔✔union
{
char key;
int num;
double price;
} val;
✔✔struct
{
char uType;
union
{
char *text;
double rate;
} uTax;
} flag;
How would you reference rate? - ✔✔flag.uTax.rate
✔✔struct
{
char uType;
union
{
char *text;
double rate;
} uTax;
} flag;
How would you access the first string in the pointer text? - ✔✔*flag.uTax.text
✔✔Dynamic Memory Allocation - ✔✔an alternative to fixed memory allocation in which
memory space grows or diminishes during program execution
✔✔Run-time allocation - ✔✔Dynamic memory allocation makes it unnecessary to
reserve a fixed amount of memory for a scalar, array, or structure variable in advance
, ✔✔Linked list (self-referencing structures) - ✔✔set of structures, each containing at
least one member whose value is the address of the next logically ordered structure in
the list
✔✔NULL - ✔✔A _______ acts as a sentinel or flag to indicate when the last structure
has been processed
✔✔malloc() - ✔✔reserves the number of bytes requested by the argument passed to
the function (ex. malloc(10*sizeof(char)) )
✔✔calloc() - ✔✔reserves space for an array of n elements of the specified size (ex.
calloc(10,sizeof(char)) )
✔✔realloc() - ✔✔Changes the size of previously allocated memory to a new size
✔✔free() - ✔✔Releases a block of bytes previously reserved
✔✔0, NULL - ✔✔The advantage of calloc() is that it initializes all newly allocated
numeric memory to ___ and character allocated memory to ________
✔✔Heap - ✔✔The space allocated by malloc() comes from the computer's __________
✔✔dynamically - ✔✔malloc() is more typically used for ________________ allocating
memory for structures
✔✔Stack - ✔✔special type of linked list in which objects can only be added to and
removed from the top of the list (LIFO), the only item that can be seen is the top
✔✔PUSH - ✔✔add a new structure to the stack
✔✔POP - ✔✔remove a structure from the top of the stack
✔✔Queue - ✔✔Items are removed from a queue in the order in which they were
entered, FIFO
✔✔Enqueueing - ✔✔placing a new item on top of the queue
✔✔Serving - ✔✔removing an item from a queue
✔✔INSERT - ✔✔add a new structure into a linked list
✔✔typedef - ✔✔permits constructing alternate names for an existing C data type name,
making an alias