Line 49 is giving me a C2679 error and I'm not sure how to fix it. Help?

#include <iostream>
#include <fstream>

using std::cout;
using std::cin;
using std::ifstream;
using std::ofstream;

const int MAX_SSN = 12;
const int MAX_WAGE = 6;
const int MAX_HOURS = 3;
const char STATUS = 1;

int ReadData ( int ssn[] [MAX_SSN], int wage[] [MAX_WAGE], int hours[] [MAX_HOURS], char status[] [STATUS] );

int main ()
{
    int ssn[11][MAX_SSN];
    int wage[11][MAX_WAGE];
    int hours[11][MAX_HOURS];
    char status[11][STATUS];

    return 0;
}

int ReadData ( int ssn[] [MAX_SSN], int wage[] [MAX_WAGE], int hours[] [MAX_HOURS], char status[] [STATUS] )
{
    int num_records = 0;

    //open file
    ifstream data_file( "PE11_1.txt" );

    //check to see if file is open
    if ( data_file.is_open() )
    {
        //read until end of file
        while ( !data_file.eof() )
        {
            num_records++;

            data_file >> ssn [num_records] //this is where i get the c2679 error
                      >> wage [num_records]
                      >> hours [num_records]
                      >> status [num_records];

        }

        data_file.close();

    }

    else
    {
        cout << "Error. Unable to open data file." <<'\n';
    }

    return num_records;

}

The arrays are declared as two-dimensional arrays and line 26 is trying to treat them as one-dimensional arrays. Why are they two-dimensional instead of one dimensional arrays?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.