R
Rick Giuly
I'm thinking about making a program in java that will allow you to use
C data-structures (probably read from a network) easily:
My question: has anyone already done this?
here's the approach that I'm thinking of:
-------
// c code
struct Person
{
int size;
int height;
char firstinitial;
}
--------
// java code
//description in java:
String[] PersonDescription =
{ "int", "size",
"int", "height",
"char", "firstinitial"
}
-----------
then you could have get/set methods that allowed this sort of thing in
java
data = (something from a c program)
data.setType(PersonDescription)'
x = data.getInt("size") // this would figure out the
// offset and give you the correct value
(Please go easy on my syntax, I use lots of languages.)
-Rick
C data-structures (probably read from a network) easily:
My question: has anyone already done this?
here's the approach that I'm thinking of:
-------
// c code
struct Person
{
int size;
int height;
char firstinitial;
}
--------
// java code
//description in java:
String[] PersonDescription =
{ "int", "size",
"int", "height",
"char", "firstinitial"
}
-----------
then you could have get/set methods that allowed this sort of thing in
java
data = (something from a c program)
data.setType(PersonDescription)'
x = data.getInt("size") // this would figure out the
// offset and give you the correct value
(Please go easy on my syntax, I use lots of languages.)
-Rick