@Manga, yes, I've got some cleaning up to do.
@Chervil, I,m not sure exactly how to do a reference variable (ifstream& DataFile).
every time I try it, I get an error. I know we talked about this yesterday and for the most part, I get it. Especially the part about when the function ends, the stream closes.
I've used functions quite a bit in VisualLisp (AutoCAD) but when you declare a variable in that language, it remains useable throughout the program until you redefine it.
However, based upon the previous discussion, and then looking at this latest code (which does have some good points, but also a lot of holes) it seems you are trying to run before you learned to walk.
The use of parameters is one of the glaring holes in the code at the start of this thread. There are no parameters passed to any of the functions.
What I'd suggest is to re-visit some of the ideas we looked at yesterday. But don't just read about them. Reading isn't sufficient. Get your compiler and write some code, it need only be ten or twenty lines long, to try out passing parameters to a function. Run the resulting program, see how it behaves, get a feel for these things by practising. I think that is a foundation which is necessary before attempting to build upon it.