I want to make the program open the file and assign 1 2 3 and 4 to different integer variables.
1 will be value1
2 will be value2 , and so on.
I cannot get it to work, this is what I tried but when I tell it to display any of the values the numbers displayed are not correct or even close. Please help!
int value1;
int value2;
int value3;
int value4;
fstream file;
file.open ("numbers.txt");
file >> value1, value2, value3, value4;
cout << value1;
system ("pause");