I am writing code in c.
I am declaring a FILE* fp at the main function (main.c).
We have other files at the project too.
So at a header file I am getting this error:
"expected declaration specifiers or ‘...’ before ‘FILE’ problem"
at this line:
void myfunct(argumenttype argument, FILE *fp);
What am I doing wrong?
Working in Linux(gedit+gcc).
You must include the header before you use the typedef'd element, otherwise FILE means nothing to the compiler, and it doesn't know what it is looking at.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With