>So, I cannot use "End of File" function at all. Right?
You can, but it would be more along the lines of stopping the input loop prematurely instead of determining the array size:
for ( int i = 0; i < 1000; i++ ) { // Don't overrun the array
infile>> P[i] >> V[i];
if ( infile.eof() )
break;
// The records were successfully read
}
Which is quite pointless when you could do this instead:
for ( int i = 0; i < 1000 && infile>> P[i] >> V[i]; i++ ) {
// The records were successfully read
}