using 2d arrays.

You do not need to use getline. You can use simply operator >> provided that each name has no more than 499 characters.:)
Otherwise you should read the whole line and then use istringstream to extract each item.

You have an input stream. You need to be able to use spaces as delimiters to parse each row so that you can pull each individual "word" out of it. Then you need to put them inside your array, once they've been completely parsed.

Also, readfile() is an int, and you're not accepting anything back. If you don't need anything back, don't give it a type. int main() needs to return something. I would recommend 0.