i want to use a program that outputs data to a text file name output.txt
---
1) the file name output.txt contain alfanumaric data. like 12T13 and 31T21.
2) load a file 12T13 or 31T21 output.txt will decide, data in files is numaric data from 100 to 9999999.
3) and if data in that file is not less then 1 devalue (--) its value in every 1 seconds. otherwise start from beginning again until the file value/data reaches to less then 1 or (kill switch is pressed)
5) if the kill switch is pressed or files value/data <1 save the file value/data and start the program again.
---
any clue how do i do it?
#include <iostream>
#include <fstream>
#include <string>
usingnamespace std;
int main(int argc, char** argv) { //auto set by dev c++ in windows.
ifstream myfile;
string DF;
myfile.open ( "output.txt" ); //open "output.txt" file
myfile >> DF ; //and load its data to DF.
cout << DF ; // DF is shown on screen. witch is 12T13
myfile.close() ;
//DF.open ( ); //the data inside "output.txt" is another file name.
// witch is alfanumaric data "12T13" now i want to load file name "12T13" and use its data the data inside
//file name "12T13" is numaric data "100" this will be decreased in ever 1 sec.
cout << "\n"; //new line betwen data and pause.
cout << "Press Enter to continue..." << endl; //pause result on screen untill user press enter key.
cin.ignore(10, '\n');
cin.get();
return 0;
}