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?
char *final = new char[100];
strcpy(final,"hiiii");
unsigned char* input = new char [100];

// very wrong... these are memory address...
//input = *final;
//copy data to destination...
memcpy((void*)input, (void*)final, strlen(hiiii));
---
Last edited on
sorry, i did not understand
do this:

input = final;

but what exactly you want to do??? this doesnt look you are trying to convert char to unsigned char.
this is not coping.. and there is a memory leak also. as input has lost its address.
Topic archived. No new replies allowed.