in my program ive hard coded the number of students from the file but im not suppost to do that. how would i go about doing it with out counting manually?

1 2 3 4 5 6

int main()
{
constint STUDENTS=642;
int scores[STUDENTS];
ifstream fin("scores2.dat");

int main()
{int i=0;
int STUDENTS=i;
int scores[i];
ifstream fin("scores2.dat");
double avg;
int minScore,maxScore;
int counts[4]={0};
{
while(fin){
fin >> STUDENTS[i];
i++;
}