Your error messages (pointer arithmetic on a function and application of sizeof to a function) are because "cubes" in your code sample is a function, not a vector.
1 2 3 4
int f(); // function taking nothing and returning int
vector<Cube>cubes(); // function taking nothing and returning vector<Cube>
int n; // number of type int
vector<Cube>cubes; // vector of type vector<Cube>
As for reading up to end of file, almost every input function, including istream::read(), has a return value that you can use.