J
Jonathan Halterman
I have data that is coming in from a network stream which I would like to
format into a struct, but I do not know the size of all the pieces of the
struct until I receive the data, so I cannot simply cast the data into my
struct as I would normally do with organized network data. The data I am
receiving looks something like this:
long lvalue1
long lvalue2
char flag
long data1len //size of data1
unsigned char data1[x]
long data2len //size of data2
unsigned char data2[x]
long data3len //size of data3
unsigned char data3[x]
If I have a pointer to the data all together, how can I separate it based on
the structure above, correctly sizing each of the data charater arrays?
thanks
jonathan
format into a struct, but I do not know the size of all the pieces of the
struct until I receive the data, so I cannot simply cast the data into my
struct as I would normally do with organized network data. The data I am
receiving looks something like this:
long lvalue1
long lvalue2
char flag
long data1len //size of data1
unsigned char data1[x]
long data2len //size of data2
unsigned char data2[x]
long data3len //size of data3
unsigned char data3[x]
If I have a pointer to the data all together, how can I separate it based on
the structure above, correctly sizing each of the data charater arrays?
thanks
jonathan