Link to home
Create AccountLog in
Avatar of dpalyca755
dpalyca755

asked on

accessing c/c++ structs in java

Is there a way to access c structs such as enumerations in java?
Please provide examples, etc..

I have a situation where I need to keep 2 libraries definitions in synch.

There is a c header file that has for example:
enum cardsuit {
   CLUBS,
   DIAMONDS,
   HEARTS,
   SPADES
};

And I need to have the same common data definition in my Java Class to avoid dual maintenance.  Is there a way to avoid have the same enumeration defined in my Java class?
ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.