CSCI 2720 Data Structures Spring 2004 Project 3 Questions/Answers Q1: I was trying to set my dictionary and tried using the '\octal()' but got an error about \o isnt a correct escape command. A1: Probably this only works if your include files give access to a library function octal( ) which produces the octal representation of its input. Rather than trying to find that, you can use '\0'+i instead of '\octal(i)'. Q2: how can my program read text, such as a file name, from the command line? A2: read section 6.1.7 of Stroustrup on Command-Line Arguments. Q3: how can my program create a file of a particular name to write to? A3: you need to associate an ostream with that file name, as discussed in section 21.5 of Stroustrup on Files and Streams. Q4: how do I get my code dictionary started? A4: your code dictionary should be an array of strings, either the new type from or else a two field struct, one field of type unsigned char * (pointing to where the array of characters is actually stored) and the other of type int to give the length of the string. If the string str is at index i in the dictionary, then i is the code. Here i is an unsigned short int, so consists of two bytes, say H and L, where H is the high order (most significant) and L is the low order byte. They should be read into the coded file (such as the .lzb file) in that order, H then L. That means you should start off the dictionary by by having the index j entry consist of the string of length one containing the character '\0'+j, for j = 0, ..., 255. When you think of j as a code (for 0 <= j <= 255) then H will be '\0' and L will be '\0'+j.