fprintf() within a subprogram
- by sergio
Im stuck when trying to write to my file within my subprogram.
void new_page(float *a, float *b, float *c, int *d){
fprintf(results,"\nPage Totals: %f\t%f\t%f\t%d", *a,*b,*c,*d);
}
I get a warning saying "Warning: incompatible implicit declaration of built-in function 'fprinf' [enabled by default]"
"error: 'results' undeclared (first use in this function)"
in main fprintf works fine, its just when it comes to the subprogram/function it wont work. from my understanding it thinks that results is undeclared, so do i have to pass the name or location of the file to make it work?