How to convert a char * to unsigned char *

Hi,
I'm facing a problem in converting a char* to unsigned char* and vise versa.
eg:

char *final = new char[100];
strcpy(final,"hiiiii");
unisgned char *input=new char[100];
input=*final; //Giving problem

and i want to do vise versa..

can any one help me in this?
 
unsigned char* input = static_cast<unsigned char*>( final );


However if you look closely at the line you call out above...

 
input = *final;


final is a char*, therefore *final is a char. You are trying to
assign a char to a pointer-to-(unsigned char), which is most
certainly not right.



I think what you want is strcpy((char *)input,final);
Topic archived. No new replies allowed.