Hey,
So I am trying to get several numbers (below ) to be stored in various variables. Could you look at my code and tell me what I am messing up? (trying to emulate an example from class that I missed, stupid swine flu...))
the numbers (yes there is a blank on line 6)
19
367
804
392
375
28903
98868
38
9287
9835
my code
# include <iostream>
# include <fstream>
# include <cstdlib>
# include <string>
using namespace std;
int main ()
{
ifstream in_stream;
ofstream out_stream;
in_stream.open("lab6file.txt");
out_stream.open("outfile.txt");
int first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth;
in_stream >> first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth;
cout << first << endl;
in_stream.close();
out_stream.close();
return(0);
}
the problem right now is that when i out "first" it gives me a random number that is not in the list.
thanks for the feedback.