posted 18 years ago
Start with
Compile that, run it. It should do nothing.
Now, add code to open a file, read a line, and display it.
Compile that; create a file "mydatafile.txt" with some text in it; run the program. It should print out one line from the file.
Now add some code to read two numbers from the file and print them. Edit the data file to contain lines of numbers. Compile the program, run it.
Repeat until the program is working!
If, at any point, the program doesn't do what it should, fix it before moving on.