I havnt finished it yet but here are my problems, when i eat a new food and record it, i want the program to put everything i have eaten in a text file all in a list. Also, when i record a food i ate and go to the main menu and record another food, the program doesnt let me input the food name. Any solutions?
One, if you are trying to APPEND to these output files, I see nowhere where you specify a mode when you open the file, so you're going to be overwriting the file, not adding to the end of it. If you want to append to the end of a file, you should specify the "app"(for "append") flag when you open the file for writing.
Also, when i record a food i ate and go to the main menu and record another food, the program doesnt let me input the food name
What precisely does it do? I'm suspicious that you may be mixing buffered and unbuffered reading functions and that you have a cin command that leaves a newline in the input stream, then your "getline" command grabs that newline and doesn't wait for you to type anything. Narue had a pinned thread on the subject. Can't find i now.
Clear the input buffer before any getline functions (i.e. line 109) with the "ignore" function.