Pre-lab 5 questions
Name:
Cnet ID:
Lab start time:

Note: There may be more than one answer. Make sure you leave
all that apply
1. All strings in C end with:
(delete the incorrect ones)
      a) \n
      b) \0
      c) \t
      d) .
      e) !

2. When you pass a string, you pass (copy to a local variable):
(delete the incorrect ones)
      a) The length of the array
      b) The length of the string
      c) The address of the beginning of the string
      d) The address of the end of the string
      e) The contents of the entire string
3. A struct
(Remove any answers that are not)
      a) is a way of organizing data into units
      b) may be nested in another struct
      c) can be compared using the == operator
      d) can be returned from a function, allowing multiple data items to be returned

4. Malloc is appropriate
(Remove any answers that are not)
      a) to return memory that was allocated inside the function
      b) to allocate an array whose size is known at runtime but not compile time
      c) as the default operation for a newly-declared pointer that is not ready to point anywhere useful
      5. Write one line of code that allocates an array of 20 integers.