CS 3733 Operating Systems, Spring 2000 Assignment 4 Comments


This assignment was graded on a basis of 30 points.

  1. You should not assume that the sentence you are playing has a fixed bound for the size.
  2. strtok modifies the string argument you pass to it.
  3. The malloc in the following sequence is unnecessary:
        x = malloc(...);
        x = strtok(xxx);
    
    since strtok returns a pointer. It dows not copy the resulting string into the left size of the assignment.
  4. In part 3 the string was to be entered as a command line parameter.
  5. NULL is a null pointer and should not be used as a string terminator.
  6. getpif returns a value of type pid_t which may or may not be the same as an int. Do not print using %d without casting.
  7. Include files may contain prototypes and typedefs, but should never contain code or variable declarations (without extern).
  8. You do not need to malloc an array of constant size.