Ok, so in the following code, the first line of the program "progfile.txt" literally reads "1". Its an int data type because I used another program to write an int to the file, and now this program is supposed to read and display it. However, for some reason, whenever I run this program, it keeps displaying the number "4273206" Why could that be?
Good call, I put in an if-statement to validate if the file was being opened and its not. I'm really not sure why that could be though, here is my new code: