Spring 2001, CSE 428: Quiz 5.2 - 22 Feb 2001


Please write your Name and Student ID,at the top of the page.
By default, this quiz will be returned in Section 2 (morning section). If you want to get it back in the afternoon section, please write "Section 1" at the top of the page.
  1. [Pts 2]

    A dynamic variable is allocated on (only one answer, please)

    1. the heap
    2. the stack
    3. the globals' space
    4. the dynamic libraries

  2. [Pts 2]

    A local variable is allocated by (only one answer, please)

    1. a "new" instruction
    2. a declaration in a procedure
    3. a global declaration
    4. an assignment

  3. [Pts 2]

    An instruction of the form p = NULL; can produce a memory leak if (only one answer, please)

    1. p was a dangling reference
    2. p was previously pointing to a location on the heap
    3. p was pointing to a location on the stack
    4. p was pointing to the some location to which another pointer, q, was pointing as well

  4. [Pts 2]

    A dangling reference is (only one answer, please)

    1. a pointer to a location which contains a dangling-else instruction
    2. a pointer set to NULL
    3. a pointer to the return value of a function which may loop
    4. a pointer to a location which is considered free

  5. [Pts 2]

    In a language with static scope the binding relevant for a non-local variable x is (only one answer, please)

    1. determined at run time as the last declaration encountered for x
    2. determined at compile time by the structure of the program
    3. determined statically by the parser
    4. determined globally as for the static variables