I am having an issue reading a 2 Dimensional Array in from a data file

Hello,
I am kind of new to C++ and I am having an issue reading in a 2 Dimensional array from a data file. I am very close to reading it in perfectly except for one issue, the loop is ignoring the first value from the data file.

This is the code I have so far:

#include <iostream>
#include <string>
#include <cctype>
#include <algorithm>
#include <functional>
#include <conio.h>
#include <iomanip>
#include <string>
#include <fstream>
using namespace std;

int main()
{

int array[6][4]={{0}};
float factory, shift;

cout.precision(2);
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::showpoint);

cout.setf(ios::fixed | ios::showpoint);
ifstream incomefile;
incomefile.open("FactoryData.dat", ios::in);
incomefile >> shift;

for (int i=0; i<6; i++)
{
for (int j=0; j<4; j++)
{
incomefile >> array[i][j];
}
}
incomefile.close();


cout << "\t" << "Shift 1" << "\t" << "Shift 2" << "\t" << "Shift 3" << "\t" << "Shift 4";
cout << "\n";

for (int a=0; a<6; a++)
{
cout << "Factory " << " ";
for (int b=0; b<4; b++)
{
cout << array[a][b] << "\t";
}
cout << "\n";
}

cout << "\n\n";
cout << array[0][0];
}


This is the values from the data file:
300 450 500 210
510 600 750 400
627 100 420 430
530 621 730 530
200 050 058 200
100 082 920 290

When the Program shows my array it comes up as:
450 500 210 510
600 750 400 627
100 420 430 530
621 730 530 200
050 058 200 100
082 920 290 0

Every array location is moved up one, like the program just completely ignored the 300 at the beginning. I have a feeling that I am missing something very simple I just can't seem to figure out what I am doing wrong, any help would be greatly appreciated.
never mind I solved it by removing the first incomefile << shift
Topic archived. No new replies allowed.