Hi all
trying to fill array with floats.
#error array subscript is not an integer
Code:
#include <stdio.h>
#define N 25
int main ()
{
int min,sec,total_sec;
float s,lapspeed,splits[N];
printf("Enter minute and seconds\n");
scanf("%d %d", &min, &sec);
total_sec = min * 60 + sec;
lapspeed = (total_sec / N);
for(s==0;s<=N;++s)
splits[s] = s * lapspeed;
for(s==0;s<=N;++s)
if (splits[s] % 5 == 0)
putchar('\n');
printf("%f\n", splits[s]);
return 0;
}
once this is fixed I plan to change array contents to char[],to convert splits to minutes and seconds. I assume I use sprintf.
Thank you