I want a way by which I can easily obtain a list of all the inputs provided by me in a program in a text file. For example, suppose I have these functions
void manip(char*,const char*,int); //a function to manipulate a string
bool Continue(); //a function which asks user to enter 'y'(yes) or 'n'(no)
cout<<"Enter main string ";
cout<<"Enter auxillary string ";
cout<<"Enter a number ";
Suppose I enter "abc", "def", 3, 'y' ,"pqr", 4 & 'n' for the cin's.
I want a way to obtain this text file:
The way to do it should not be writing "file<<" after every cin.
It should be like calling a function at the end of my program which will retrieve all input given during the program and write that to a file.
Or it can be a function that I call at the beginning of my program which will start syncing a file to whatever I type.
Edit: This would be a good way to keep track of what input I provide in a program. If I copy all the stuff in the file and paste it when I run a program again, I'll be able to replicate the program output and save time if the program asks for a lot of input.
Edit: This question was earlier in the Windows forum, but I shifted it here as I was getting no reply there and I'm not sure in which forum this question really belongs to. If you think this was a bad idea, please tell me.