Since you have a running program, you only need to change the private variables in the header files and the code in the cpp files for the primary indexes so they use a dynamic array or vector instead. For the primary index, the initial vector size will be 8. The non-menu-driven conversion program will report nothing to the user. When the vector needs to change size upward, you will double its size. Note: since the indexes can store the number of records in its auxiliary file, you can start the vector at that size (or slightly larger) when you start the menu-based program
Why don't you tell us what the assignment is. In you last thread you asked what kind of dynamic array or vector could be used. The std::vector fits that bill. You are on the right track here, but there are some syntax errors that need to be cleaned up.
However, you now ask to not use std::vector. It sounds like that may be an assumption in the assignment, which is fine, but there is some ambiguity in what you are asking.
The quick answer is to make index an Entry* and in the constructor do index = new Entry[8];. I think. Based on my understanding of your question. But without better understanding exactly what you are asking, I can't be certain that's what you want.
Got it. The original file had struct Entry { ... } [25];. Now we want the size of the array to change dynamically.
First, go back to the original code you started with. The std::vector suggestion doesn't fit within the parameters of the assignment. (Sorry about that--I didn't know.)
Instead of statically allocating 25 Entries, create a pointer to an array of entries, and allocate the array in the constructor.
You will need to keep track of the current size of the Entry array. When you are adding an entry and you exceed your capacity, you need to:
1. Allocate a new array twice the current size
2. Copy all of the elements from the original array to the new one.
3. Delete the original array.
4. Insert the new entry as normal