R
richard.usenet
I want a 'binary' value to be included in a managed string. ie a binary
0x01 not its ascii equivalent of 49 decimal or 0x31 hexidecimal.
The following code converts the checksum unsigned char to it's ascii
value when using visual studio express 2005. What do I need to do to
force visual studio not to do the conversion? Thanks.
{
unsigned int checksum = 0;
unsigned char checksum_string[2];
String^ message;
for(int i=0; i<stuffed_message->Length; ++i)
{
checksum += stuffed_message;
}
checksum_string[0] = (unsigned char) ((checksum>>8)&0xff);
checksum_string[1] = (unsigned char) (checksum&0xff);
message += (unsigned char) checksum_string[0]) + (unsigned char)
checksum_string[1];
}
0x01 not its ascii equivalent of 49 decimal or 0x31 hexidecimal.
The following code converts the checksum unsigned char to it's ascii
value when using visual studio express 2005. What do I need to do to
force visual studio not to do the conversion? Thanks.
{
unsigned int checksum = 0;
unsigned char checksum_string[2];
String^ message;
for(int i=0; i<stuffed_message->Length; ++i)
{
checksum += stuffed_message;
}
checksum_string[0] = (unsigned char) ((checksum>>8)&0xff);
checksum_string[1] = (unsigned char) (checksum&0xff);
message += (unsigned char) checksum_string[0]) + (unsigned char)
checksum_string[1];
}