I guess that I'm not sure where to call the macro: Here is the relevant code:
Code:
printf("Enter File Name: ");
scanf("%s",fileName);
printf("\n\n");
sp = fopen(fileName,"r");
if(!sp){ /* there is no file with given filename*/
printf("Error could not open file %s for read. \n\n",fileName);
exit(0);
}else if( fgetc(sp)==EOF){ /* no data in file,fileName valid */
printf("There were 0 files in %s.\n",fileName);
exit(0);
}
/*************
the fscanf function reads data in from the stream
it takes 3 parameters: stream pointer,conversion code, where to place data
*************/
while (( getchar()) != '\n' & sp != EOF);
while(k=(fscanf(sp,"%lf",&data[i++]) == 1)) {
b += k++ ;
}
fclose(sp);