Problem: How can I read from a file (Using C++)? I used this code but it does not work . I put it in the same path.
#include <fstream>
int main ()
{
int x;
ifstream fin ("data.in");
fin >> x;
ofstream fout ("data.out");
fout << x*2;
fin.close();
fout.close();
return 0;
}
#include <fstream>
int main ()
{
int x;
ifstream fin ("data.in");
fin >> x;
ofstream fout ("data.out");
fout << x*2;
fin.close();
fout.close();
return 0;
}