Here is a list of problems I have seen and suggestions for A2: 1. You can't store an entire file in main memory. Even the index file is too large. 2. Pointers in/to a file record do not work the same as regular C++ pointers. Both are integer values, but memory pointers refer to an address in main memory, whereas file pointers refer to a byte poisition in a file. Review the tutorial notes on file position indicators to clear this up. 3. Some have suggested using a Btree or BST as the index. This is a design decision, but I'd like to point out that it will consume more time (especially the Btree). I suggest using a simple index to start, and if there is time remaining, go ahead and implement the better structure. This assures you will have the assignment completed. 4. When writing records to a file, be careful when updating and inserting -- watch you don't overwrite a record you didn't intend to. 5. When inserting records to a file, it is very inefficient to find the spot somewhere in the middle, push all those records down, and then insert the record. Your notes have better suggestions. 6. Some students provided command line options to decide whether to create or update existing files. I believe the handout states that if the files exist, you update, otherwise create. So all you need to do is provide the filenames. Style Suggestions: 1. Do not use seek and tell to determine when the end of file is reached. I've noticed some have the following: seek(end) eof = tell() seek(beg) while (1) { cur = tell() if (cur == eof) break. read_some_record } This provides unnecessary seeks -- inefficient. You can keep using the eof () check of the file stream. 2. Use seek appropriately. You do not need to seek if reading/writing sequentially. 3. Always check if memory was allocated after a new() and if a file was openened correctly after a call to open(). 4. When deleting in a destructor, always check to ensure the memory was allocated to that object before deleting. 5. Suggestion: when desigining your classes/functions, try to break the objects and methods to their simplest forms; i.e. avoid placing too much functionality within a function or class. ----------------------------------------------------------------- Vincent Corvinelli