I have a callback function which has the parameter const unsigned char *pData. everytime I hit the callback function I need to store the pData value into my local unsigned char* variable. Is there any function to copy the data?
Edit: Here is a code sample:
void Callbackfun(int x, const unsigned char* pData, const UINT cbData) {
switch(x) {
case 0:
// ptr is a global variable of structure containg name and number
ptr.name = (unsigned char*)pData;
break;
case 1:
ptr.number = (unsigned char*)pData;
break;
}
}
now every time this function is called i want to store the pData values in my local structure (as shown by ptr.name).