P
Panchal V
I want to access a variable length record in C, the format is as
follows :
+---+---+-----------+
| A | L | D A T A |
+---+---+-----------+
A - Some Data (1 BYTE)
L - Length the Data that follows (1 BYTE)
then actual data
I want to access and represent this record using struct/union in c,
how can I do it...
Data is variable length, L tell the length of data (in bytes) that
follows...
So that I can access it in this manner :
pData->A = 56;
pData->data[pData->L - 1] = '\0';
Now I want to represent
+---+---+-----------+---+
| A | L | D A T A | B |
+---+---+-----------+---+
where B - is some data ( 1 byte)
I want to access it like this
pData->B
(Remember it is after variable length data)
How can I do it....????
-Neo
follows :
+---+---+-----------+
| A | L | D A T A |
+---+---+-----------+
A - Some Data (1 BYTE)
L - Length the Data that follows (1 BYTE)
then actual data
I want to access and represent this record using struct/union in c,
how can I do it...
Data is variable length, L tell the length of data (in bytes) that
follows...
So that I can access it in this manner :
pData->A = 56;
pData->data[pData->L - 1] = '\0';
Now I want to represent
+---+---+-----------+---+
| A | L | D A T A | B |
+---+---+-----------+---+
where B - is some data ( 1 byte)
I want to access it like this
pData->B
(Remember it is after variable length data)
How can I do it....????
-Neo