Assignment 7, due July 7
Part of
the homework for 22C:50, Summer 2004
|
a) Propose a representation of objects of type FILE as used in the C standard library to represent output data streams, inasmuch as you can infer this from the manual information about the putc and write calls.
b) Propose an implementation of the fputc function in terms of your representation proposed in part a. Ignore any strangeness involved with interactive files.
c) Explain why it is useful to have a macro, putc as well as a callable function, fputc to perform the same operation.
a) What are the methods applicable to the objects of class queue that are required by this driver?
b) What variables or data structures must be encapsulated into each queue object (that is, used for the representaton of each queue object)? To answer this question, you will have to select an appropriate queue implementation.
c) When would you input/output driver allocate (instantiate) new queue objects and what would be the lifetime of these objects?