Spring 2001, CSE 428: Quiz 5.1 - 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 by (only one answer, please)

    1. a declaration of a dynamic class
    2. a declaration of a dynamic function
    3. a declaration of a variable of type pointer
    4. a "new" instruction

  2. [Pts 2]

    In the standard implementation of C and C++ a local variable is allocated on (only one answer, please)

    1. the heap
    2. the stack
    3. the globals' space
    4. the local data base

  3. [Pts 2]

    A memory leak is (only one answer, please)

    1. a location in the heap which is leaking information
    2. a location which is free for further allocation
    3. a location on the heap which is not free and not accessible from the program
    4. a location on the stack which was not deallocated when the AR was removed

  4. [Pts 2]

    A dangling reference can be produced by (only one answer, please)

    1. a delete instruction
    2. a dangling-else command
    3. an assignment of the kind p = NULL; where p is a variable of type pointer
    4. a declaration of a variavble of type pointer

  5. [Pts 2]

    The difference between static scope and dynamic scope is relevant in languages which (only one answer, please)

    1. allow both static and dynamic execution of programs
    2. allow both static and dynamic type checking
    3. allow both static and dynamic variables
    4. allow nested procedure declarations