This is pretty basic, but I must just not be seeing my mistake. I'm trying to open prog2.txt, which is in the same directory as my program, then read in and immediately spit out whatever strings I get. However, when I try to run the program, it simply prints the intial value of mystring, "STARTVALUE! " over and over in an infinite loop.
Why isn't mystring getting a new value from infile, and why isn't my loop ending?
You need to check if your program and text file really are in the same directory, or if the file name matches what you have in your cpp file.
You can test if your code finds your text file by using the is_open() function. Step through your code in the debugger and see if it actually opens your text file.
If the file isn't found, you'll get the results you're seeing.