okay this is what i have so far but it keeps giving me the wrong value
insert
Code:
#include<stdio.h>
#include <string.h>
FILE *fp; //*=multiplication, in this case special variable called pointer
char fn[300]; //a character array
int main(int argc, char *argv[])
{
int i; //this is a counter
int n; // this is the number of points THESE MUST BE INTEGERS, data
float a[50]; // these must be floats
float b[50];
float max;
float width;
float threshold;
float blank;
float beattime;
strcpy(fn,argv[1]); // 1 means the first file not argv[2]
fp = fopen(fn,"r"); // r means open readab
i = 0;
threshold = 2 ;
blank = 1;
while(b[i] < threshold) {
i++ ;
}
beattime = a[i];
printf("The fdimum is %f\n", beattime); // print to terminal
//then do it again
fclose(fp); // close the file
return 0;
}