Реализована функция print_in_hex

Этот коммит содержится в:
2024-12-23 10:26:42 +03:00
родитель 09482a7dd9
Коммит 89e33de970

Просмотреть файл

@@ -28,8 +28,20 @@ void test_nibbles() {
cout << "Nibble extraction tests passed!\n";
}
void print_in_hex(uint8_t byte) {
cout << nibble_to_hex(high_nibble(byte))
<< nibble_to_hex(low_nibble(byte));
}
void test_print_in_hex() {
print_in_hex(0x0); cout << "\n";
print_in_hex(0xab); cout << "\n";
print_in_hex(0xff); cout << "\n";
}
int main() {
test_nibble_to_hex();
test_nibbles();
test_print_in_hex();
return 0;
}