CSci 170: Analysis of Programming Languages

Concordance: a C programming assignment

A concordance of a text is a listing of every string that occurs in the text along with the locations of that string. Here's an example run of such a program.



This program lists the occurances of each word. For instance, the word "and" occurs four times in the text—at word number 16, word number 44 word number 80, and word number 98.

Your assignment is to create, test, and run such a program. Turn in a printout of the source code and of a test run of your program with the Alice text or anything else you like of approximately the same length and complexity.

You may start your program from scratch, or you may use the partially written code at concordance.c which refers to the header file concordance.h. It has function stubs for the important functions; you'll have to fill them in.


Back to the course page.