c - What return type should I declare a function with if I don't care about the return value? -


in c file, calling function defined in generated file, lex.yy.c:

yy_scan_string(input); 

which declared following in lex.yy.c:

yy_buffer_state yy_scan_string(yyconst char *yystr); 

and in turn yy_buffer_state typedef:

typedef struct yy_buffer_state *yy_buffer_state; 

none of these available include header file. while in order call yy_scan_string have declare first.

what best way declare function in source file, when don't care return value @ all, , it's infeasible include type definition of return type?

the universally accepted procedure define function in header-file , include file @ start of file call from.

if reason header file hasn't provided make it.

if it's handful of functions declare them locally in .c file.

the function returns pointer structure can use forward declaration:

typedef struct yy_buffer_state *yy_buffer_state; 

however can recommend remove declarations own file.


Comments