From 59508931bc42064c23d5fbcb062d6f7396a873ab Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 30 Mar 2022 20:20:32 +0300 Subject: Solved dimitriev hw (sem 3, ex4) --- .../Solutions Sem. 03/ex4/Bytex.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/Bytex.h (limited to 'Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/Bytex.h') diff --git a/Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/Bytex.h b/Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/Bytex.h new file mode 100644 index 0000000..fc39e7a --- /dev/null +++ b/Year 1/Object-oriented Programming/Solutions Sem. 03/ex4/Bytex.h @@ -0,0 +1,17 @@ +class Bytex { + char hexVal[2]; + char byteVal; + + char digitToHexChar(unsigned 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; +}; -- cgit v1.3.1-26-gb76a