Indicativamente:
Codice:
int leggi_file(double data[], int max)
{
int num = 0;
ifstream f("nomefile.ext");
while(num < max)
{
f >> data[num];
if(f.eof())
break;
num++;
}
return num;
}
Sperando che riesca ad interpretare quella sequenza numerica come un numero floating point. Se non ci riesce dobbiamo fare un po' di casino