View Single Post
Old 05-26-2004, 12:21 PM   #3 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
How are the two bytes stored and to what (in what datatype) do you wish to store the single byte.
In case you were looking for what Blood Night meant, then here is a play thingy:
Code:
#include <iostream.h>

const unsigned short currentbyte = 0xB3;

int main()
{
	//unsigned short = max 2 bytes; e.g. 0xFF;
	unsigned short value, remain;
	
	//A bit of toying: 0x10 = 16 Decimal!

	value = currentbyte / 0x10;
	//Convert to hex
	cout<<hex<<value<<endl; //b
	cout<<value<<endl;	//b
	//convert to decimal
	cout<<dec<<value<<endl;	//11
	cout<<value<<endl;	//11
	
	remain = currentbyte % 0x10;
	cout<<hex<<remain<<endl;	//3
	cout<<remain<<endl;		//3
	cout<<dec<<remain<<endl;	//3
	cout<<remain<<endl;		//3

	return 0;
}
__________________
Valmont is offline   Reply With Quote