BYTE* to char* or BYTE* to CString ?
-
Can I cast BYTE* to char* , or BYTE* to CString and then back to BYTE ? What should I use for that ?
Lookup the CP author Mike Dunn. Then look at his String-articles (which he coauthored with Nishant). It should answer any questions you may have on strings. :) -- An eye for an eye will only make the world blind.
-
Can I cast BYTE* to char* , or BYTE* to CString and then back to BYTE ? What should I use for that ?
BYTE == unsigned char. You can cast it. You cannot cast BYTE* to CString, it's plainly not an instance of the CString class. CString s((char*)myBYTE*); should work tho. Christian Graus - Microsoft MVP - C++
-
Can I cast BYTE* to char* , or BYTE* to CString and then back to BYTE ? What should I use for that ?
-
You cannot cast a BYTE* to char* or CString, but you can convert it to char* whit this method: char* CAST(BYTE* bytes,int numberOfBytes) { char *result=new char[numberOfBytes]; for(int i=0;i