I create the dynamic array with malloc and assign the last char to NULL. When I assign the NULL character, the warning message as follow appear:
'=' : 'unsigned char ' differs in levels of indirection from 'void *'
The code is as follows:
void main()
{
const char sendText[] = "Hi";
buffersize = strlen( sendText );
buffer = (unsigned char*)(malloc( buffersize + 1 )); memcpy( buffer, sendText, buffersize );
buffer[buffersize] = NULL;
}
Thanks a lot.
Rgds,
perlsu