Click to See Complete Forum and Search --> : pointers concept


snowyee
January 7th, 2008, 11:38 PM
hi..im very new to data structures.... can someone explain this coding....thanks in advance




void PrintRxData(RX_DATA_STRUCT* pRx)
{
api_header_t* pri;
USHORT datlen, ln;
PUCHAR data;

pri = &pRx->api_header;

//
//NOTE: if running in BitStream mode, there will be TOO MUCH to print
datlen = pri->data_length;
data = pRx->data;

printf("Rx datlen : %d. Data :\n", datlen)
}

MrViggy
January 8th, 2008, 11:53 AM
Not sure what you mean. Basically, a pointer to the struct/class RX_DATA_STRUCT is passed into the function. One of the members of that struct appears to be a 'api_header_t', and the address of that member is assigned to the variable 'pri'. Then the function just prints out the length of the "data" in the structure.

Viggy