Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Solutions Sem. 03 / ex4 / Bytex.h
blob: 67f3c57d40cc952fc1c8047460326f25e4fa8a89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Bytex {
	char byteVal;
	char hexVal[2]; // Normal bytes are up to 255, which is FF in Hex

	char digitToHexChar(int digit);
	int hexCharToNum(char hexChar);
	void byteValToHex();
	void hexValToByte();

public:
	Bytex();
	Bytex(char byteVal);
	Bytex(const char* hexVal);

	char getByte() const;
	void getHex(char* output) const;
};