• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Structure

 
Isaias C. Barroso
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I need to transfer the follow Data Structure for to a Socket with J2ME
Structure in C
typedef struct data_outboundrec
{
unsigned long intcnumber;
unsigned chardevice_id[20];
unsigned char data[255];
unsigned intdatasize;
} DATAOUTBOUND_REC;
how to make this.
Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would do that by creating a byte[] and writing methods to fill/extract each of the variables. That way you have total control over ended-ness.
Transmitting / reading a byte[] is just one call.
Bill
 
Isaias C. Barroso
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic