Your fileReading function signature is wrong. Instead of
static int fileReading (int, int, int);
it should be
static int fileReading(int, int*, int);
Compiler clearly tell you that:
main.cpp:32:74: error: invalid conversion from 'int*' to 'int' [-fpermissive]