hi
in my application there is some error:cast from unsigned char* to unsigned char..
how to convert unsigned char* to unsigned char.
if anybody knows then reply
hi
in my application there is some error:cast from unsigned char* to unsigned char..
how to convert unsigned char* to unsigned char.
if anybody knows then reply
Well, that (unsigned char*) variable can be either a pointer to a single char or can be an array.
Depends on how it is allocated.
Anyway, you have to dereference it:
So, everything depends on how the pointer was allocated.Qt Code:
unsigned char chr = 23; unsigned char* ptrChar = &chr; // pointer to a char unsigned char* arrayChar = new char[20]; //an array unsigned char valChar = *ptrChar; // now val char equals 23 unsigned char firstChar = *arrayChar; //now firstChar equals arrayChar[0].To copy to clipboard, switch view to plain text mode
BTW, I think you should have posted in the general programming forum.
Regards
Bookmarks