I’m kind of new to C ++, working on a compact Windows CE.net application
when trying to write hexadecimal data to a file
CString dataBlock1;
dataBlock1 = "";
CString temp;
for(int i = 0; i < rLen; i++)
{
temp.Format(L"%02X ",rec[i]);
dataBlock1 += temp;
}
std::ofstream out(file);
I get this error, cannot convert parameter 1 from wchar * to const char * when using the following write function to write hexadecimal data to a file
out.write(myReader.dataBlock1.GetBuffer(),myReader.dataBlock1.GetLength());
how can we convert wchar_ * to const char * for the write function to work.
Thank.
source
share