I'm trying to make a program that outputs every hour and minute of the day in
hh:mm format and then print all of that to a text file.
However, I have no idea how to make it go about printing it as
00:00
00:01
00:02 and so on.
Any help would be appreciated, as well as how to make it write every single timestamp to a text file.
Thanks in advance.
Code:#include <iostream> #include <fstream> #include <iomanip> using namespace std; int main () { int n; int m; cin >> n; while (n>-2 && n<24) { cout << setfill('0') << setw(2) << ++n << ""; } cin >> m; while (m>-2 && m<60) { cout << setfill('0') << setw(2) << ++m << ""; } cout << n << ":" << m; system("PAUSE"); EXIT_SUCCESS; }