T
Tim Wong
All:
I am trying to convert a CString value to an unsigned char array.
I found some code online that will allow me to compile, but when I try
to print out...i get a whole mess.
/*Begin Code*/
CString day("01");
unsigned char testDay[2];
//Code snippet found online
strncpy((char *) testDay, (LPCTSTR) day, sizeof(testDay));
printf(day);
/*End Code*/
Up there i am trying to "cast" the Cstring into an unsigned char[2].
Any suggestions? What if it were the other way around...how would you
go about doing that?
I am trying to convert a CString value to an unsigned char array.
I found some code online that will allow me to compile, but when I try
to print out...i get a whole mess.
/*Begin Code*/
CString day("01");
unsigned char testDay[2];
//Code snippet found online
strncpy((char *) testDay, (LPCTSTR) day, sizeof(testDay));
printf(day);
/*End Code*/
Up there i am trying to "cast" the Cstring into an unsigned char[2].
Any suggestions? What if it were the other way around...how would you
go about doing that?