I'm new here and to coding in general...im about 1/3 through a beginner c++ course. I have branched off a little and am trying desperately to consistently build a functional program that reads and writes from external files.
The following code has yielded success, but not every time and I have no idea why. I have scoured the internet and used many, many different blocks of code trying to get this to work every time. Im sure I'm missing something important....but I'm pulling my hair out trying to find it.
This works sometimes. Once it works once, it will continue until I shut down the program and start again. The file extension is text, not txt. I use codelite primarily, but I have also tried this with visual studio. I do make sure the file is in the folder. Any help would be greatly appreciated.