Using an enum as a parameter and a return type in a function in C -
if decided use enum, such one:
typedef enum { false, true = !false } bool;
as parameter, , return type in function:
bool foo(bool param) { <do something> return true; }
would cause problems? example, across compilers.
ps: don't intend use #include <stdbool.h>
since don't intend #include <stdbool.h>
(which might cause conflicts), there should not problem approach.
however, if big project, others contribute too, wouldn't recommend go on approach, because might include header. moreover, if decide use code in future project of yours, pretty sure not remember detail prevention of including header, except if document nicely.
Comments
Post a Comment