I'm trying to convert a const unsigned char*
to char*
as well as make a copy. I have tried several variations of the code below but I usually get a memory exception. This function resides in an application written in C.
The below function is what I'm trying to create
//global variable
char* copiedValue;
void convertUnsignedChar(const unsigned char* message){
copiedValue = malloc(sizeof(message));
(void)memcpy(copiedValue, message, sizeof(message));
}