Please Use Code Tags! It makes it easier to read of everyone. http://www.cplusplus.com/articles/jEywvCM9/
I don't get that error, but I do get an error on line 15 where you are incorrectly transferring your integer arrays.
Just to make it easier on you I would recommend that you just make all the variables global.
#include <iostream>
#include <fstream>
usingnamespace std;
int readdata(int , int nums1[], int []);
int main()
{
int n, score1[n] , score2[n] , i;
ifstream file;
file.open("scores.txt");
file >> n ;
cout << "n=" << n << endl;
readdata(n, score1[n],score2[n]);
int readdata (int x , int nums1[n], int nums2[n]);
{
for( i= 0 ; i < 10 ; i++ )
{
file >> score1[i] >> score2[i];
cout << score1[i] << "\t\t" << score2[i] << endl;
}
}
}
Line 14: Second argument is of type int where an array of ints is expected. Line 16ff: You're defining a function inside another functions body. This isn't allowed in C/C++. Line 8: You're defining two arrays with an undefined size due to an undefined value of variable n.