CS 3733 Operating Systems, Spring 2000 Assignment 4 Comments
This assignment was graded on a basis of 30 points.
You should not assume that the sentence you are playing has a fixed bound for the size.
strtok modifies the string argument you pass to it.
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.
In part 3 the string was to be entered as a command line parameter.
NULL is a null pointer and should not be used as a string terminator.
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.
Include files may contain prototypes and typedefs, but should never contain code or variable declarations (without extern).
You do not need to
malloc
an array of constant size.