My situation is this:
- a header
aux_func.hwith prototype of a functionint check_format_file(FILE * file); - a source file
aux_func.cwith implementation of that funcion
The question is: In my main.c, where and how is better to declare FILE * f ?
- As a static global variable
#include aux_func.h
static FILE * f;
int main() { check_format_file(f); /* other stuffs */ return 0; }
- As an istance variable declare in
main?
#include aux_func.h int main() { FILE * f; check_format_file(f); /* other stuffs */ return 0; }
My doubt is about the correct visibility of FILE *f.