I have this code and I can't figure out why my ofstream isn't working as it should within it's folder. When I run the current code, my 'black box' in codeblocks shows all my information, while the .txt file has nothing, it's empty.
You need to actually output things to the file to see things. Just opening a file doesn't cause all subsequent std::cout's to go to both the terminal and the file. That would just be annoying.
If you want your output to go to the file then pass Descent to your print function (as a std::ofstream&) and output to it instead of std::cout.
You need to pass it as a reference ostream&
And note that it just needs to be an ostream, not an ofstream
An ostream is higher up the class hierarchy and therefore can accept, for instance, std::cout as well as an ofstream (or even an ostringstream).
When I said I couldn't "parse" that I meant I couldn't understand your question. If your current IDE is randomly opening files that you didn't request then there's obvioudly some kind of serious problem.
As for printing the header, you need to make an actual function call. All you've done is put a declaration of the printHeader function in the middle of main. Get rid of that and make it a function call:
Alrighty, SO, now i have the header printing to file. But it is repeating the header on each line. I just need the header to print once and insert the numbers into a list format.
Think about why the header is printing over and over again, almost as if it was in a loop. You just might be able to crack that one.
To line up the numbers properly under the header you'll need to use setw. I'm not sure if you really want your numbers left-justified, so you might want to get rid of left.
Although it doesn't make a difference in your specific case to use ofstream, it needlessly limits the use of your print functions. Suppose you wanted to print the information to the terminal first, and then ask the user if he wants a copy printed to a file? In that case it would be nice to be able to pass std::cout to the print functions and have them output to the terminal. If you use ostream it can accept either std::cout (which is an ostream) or an ofstream. This is because ofstream "inherits" from ostream and therefore can act like one. You probably have yet to learn about class hierarchies. Suffice it to say that you should use ostream (or istream for input) unless the function uses methods specific to files (like open, close, is_open), in which case you would need to use ofstream.