So i've copied a program from my textbook that reads numbers from a file and then displays them. However for some reason I keep getting large random numbers for my output on the consol. Please helpe me fix this. The text file "TonyNumbers.txt" has the numbers 1 through 5, each with their own line.
It's only supposed to be numeric data so I don't need strings. Yet. I'm just building a simple driver to figure out why my other program wasn't functioning properly.
You're program worked, sorta. It pops up saying it can't find my file (saved it on the desktop) and then asks me to enter the file name. I type in the same file name it says it couldn't find and then it suddenly finds it :/??
EDIT: Do you have any idea what those random numbers were and how I can avoid them in the future? I'm a lowly comp sci 1 student and don't know these things (if you couldn't tell already lol). My best guess is that it's somehow reading something from the buffer.
You're program worked, sorta. It pops up saying it can't find my file (saved it on the desktop) and then asks me to enter the file name. I type in the same file name it says it couldn't find and then it suddenly finds it :/??
I have updated my test driver, hopefully it works this time. I use a while loop.