I've looked on the net and in several books and I still can't figure out how to do this. In C, I would have done
The best I've come up with is
Only problem is the static decls have to be in a class. If I put them in the classes, then the classes can't refer to each other. Any suggestions would be helpful.
Code:
#define OVERALL_SIZE 1400
#define ONE_SIZE (OVERALL_SIZE - 8)
struct One
{
int onea;
int oneb;
unsigned char mdata[ONE_SIZE];
};
#define TWO_SIZE (OVERALL_SIZE - 4)
struct Two
{
float twoa;
unsigned char mdata[TWO_SIZE];
};
Code:
static int OVERALL_SIZE = 1400;
static int ONE_SIZE = OVERALL_SIZE - 8;
static int TWO_SIZE = OVERALL_SIZE - 4;
class One
{
public int onea;
public int oneb;
public byte mdata[ONE_SIZE];
};
class Two
{
public float twoa;
public byte mdata[TWO_SIZE];
};