i am not able to do the concept of input and output file in WINDOWS .
please help me with this concept.
Input and output file
hello @tanvi2002 this is the concept for the understanding how online compilers when you submit any code works there.
they have a file there for the inputs from which they give input to your code and they have one output file from which they compare your output .
if you are using sublime for your coding part then for the execution you always have to go to the terminal to run your code .
but if you type these lines in your main function :
#include <bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
cout<<"Hello World!";
return 0;
}
then you will see that there will be output in your output.txt file . and your program will take input from your input .txt file .
i hope i have cleared your doubt .
Happy Learning !!
hey @tanvi2002
as you are not responding to the doubt which you have raised above a month ago i hope your doubt is now cleared and you can now mark this doubt as cleared and do hit the like button.
Happy Learning !!
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.