Yea, I have actually thought about this even before. This hole in the file is what bothered me when I thought about this index method earlier, that's why I thought it was stupid idea in the first place.
Anyway I'm just experimenting this and it is a college assignment and I still have some spare time left so it won't be a problem.
And btw, what you have told me has given me a very good understanding of how file processing works and given me more interest in C++