fprintf() within a subprogram
Posted
by
sergio
on Stack Overflow
See other posts from Stack Overflow
or by sergio
Published on 2012-04-12T23:12:23Z
Indexed on
2012/04/12
23:29 UTC
Read the original article
Hit count: 234
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?
© Stack Overflow or respective owner