So the first part of this program is to pull int data from a .txt file and put them into an array and then output then on the screen, but it seems that the code I have will only display very odd numbers (i.e. -808459), I do not know where this is coming from.
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
int Array1[10];
int index;
ifstream FileIn;
ofstream FileOut;
FileIn.open ("E:\\fileinput.txt");
for (index = 0; index < 10; index++ ){
FileIn >> Array1 [index];
cout << Array1 [index] << " ";
}
return 0;
}