read only one line from text file
hi everybody,
I want to write a program that continuously prints an incremented value on
the screen in addition to continuously accepting new increment values from the user.
Exactly every one second, the program must print a message on the screen, whether there is input
from the user or not.
The example below illustrates the program’s execution assuming an increment value of 1:
10: Enter new increment value?
11: Enter new increment value? 5
16: Enter new increment value?
21: Enter new increment value?
If there is no input from the user, the same increment value is used. The initial increment value is 1.
The user can change the increment value in three possible ways:
1. By entering an integer value when asked to by the program.
2. By entering a text file name containing the increment value.
3. By sending a signal to the program with the signal number representing the increment value.
If the file name was used before, the next integer value in the file is used. There may be multiple opened files at any given time.
What i want is to give me a solution how to do it with multiples files and forget about the other two ways.
|