So I'm following my professors powerpoint and I think what I'm doing is correct, the issue I am having is when I execute my program I am unable to input anything. Image at the bottom "The input file should have some integer values (e.g., 10 values) separated by whitespaces."
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream myfile;
ofstream newfile;
myfile.open("test.txt");
newfile.open("new_test.txt");
cout <<"test.txt is opened to get input from it"<<endl;
cout <<"new_test.txt is opened to write in it"<<endl;
int mynum;
while(!myfile.eof())//finding whether end of file is reached
{
myfile>>mynum;
newfile<<mynum<<endl;
}
myfile.close();
newfile.close();
return 0;
}
My program isn't letting me input any letter/numbers or anything else for that matter.