I'm trying to test freopen("inputs.txt","r",stdin);
but it is not working.Here is my code below:
#include <iostream>
using namespace std;
int main() {
freopen("inputs.txt","r",stdin);
int n;
cin >> n;
cout << n << endl;
return 0;
}
There is only one integer number in my input file and it is in the same directory.
Can anyone help?