if I wrote like this:
typedef enum {
foo_1,
foo_2
}foo ;
I found that I can use
int footype = foo::foo_1 in c++
and I can directly use
int footype = foo_1 in c,
so is there a way that can write same code that works both in c++ and c? the code is inside one header file with only one structure.
foo_1without the namespace, it should work in both, althougt you have to declareusing namespace foofor c++fooafter thetypedef, sorry