void capturat(i vec[5])
{
float i; for (i=0;i<=5;i++)
{
printf("Dame los tiempos 5 maximo:\t");
scanf("%f",&vec[i]);
}
}
float imprimet(float vec[5])
{
float i;
for(i=0;i<5;i++)
{
printf("Tu tiempo es %f \n",vec[i]);
}
}
The compiler says that I have an "array subscript is not an integer" in the functions capturat() and imprimet().
void capturat(i vec[5])is not valid, perhaps you meant:void capturat(float vec[5])float i; for (i=0;i<=5;i++)should be two lines.scanf(), always check the returned value (not the parameter value) to assure the operation was successful. In this case use:if( 1 != scanf("%f",&vec[i]) ) { perror("scanf() failed"); exit( EXIT_FAILURE ); }Where the 1 is the number of format specifiers in the format parameter