Why doesn't this code write/read the arrays properly?

I am trying to make a phone book type of console app for my project. This is the first time I use files, and I am having a small problem.

void fileinput(long long phonenumber[], string contactname[], int& size, int& index) {
    ofstream out;
    out.open("project.dat", ios::binary | ios::out);
    out.write((char*)&size, sizeof(size));
    out.write((char*)&index, sizeof(index));
    out.write((char*)&contactname, sizeof(contactname));
    out.write((char*)&phonenumber, sizeof(phonenumber));
    out.close();
}

void fileoutput(long long phonenumber[] , string contactname[], int& 
    size,int&index) {
    ifstream in;
    in.open("project.dat", ios::binary | ios::out);
    in.read((char*)&size, sizeof(size));
    in.read((char*)&index, sizeof(index));
    in.read((char*)&contactname, sizeof(contactname));
    in.read((char*)&phonenumber, sizeof(phonenumber));
    in.fail();
} 

These 2 functions are supposed to take my 2 arrays, along with the size and the index, and input/output them from a file.

My problem is that the file inputs and outputs both the size and the index perfectly fine, but not the arrays (I don't know if it's the input or the output). Whenever I try to display the arrays, they are simply empty.

What's wrong with these functions?