Kirants,

I am not sure I follow, I think I understand that what you are suggesting is that the category in the struct is itself made up of a char array of szData

We then read the buffer and keep extracting letters until we hit a null and then we write the szData array to category and repeat for all 18

However, since pdata will contain the whole string "Green Brown Orange" the comparison if((*pData) == '\0') will never be true until the very last byte and therefore will only write 1 entry rather than 18...

So I am assuming I need compare something that is only looking at the next byte in pData and compare that to Null...

Any ideas....Thanks