c - Passing a FILE pointer to a function and getting error message 'FILE is an unknown type name' -
i'm trying pass pointer function, compiler throws error saying 'file unknown type name'.
in main:
file *fp = fopen(argv[1], "r"); get_tok(fp);
function declaration throws error:
int get_tok(file *fp)
am not including .h file or something?
the best way not open file outside function..declare file pointer. , inside function, use fopen , if return value 0 or null return 0 or else return 1..and read returning value main yo decide of file has been opened successfully..
Comments
Post a Comment