Skip to content

Instantly share code, notes, and snippets.

@HyperPlay
HyperPlay / byte_to_bits.cpp
Created August 28, 2019 04:13
Byte to bit conversion without bitset from the standard library.
#include <iostream>
using std::cout, std::endl, std::string;
string byte_to_bits(uint8_t byte);
char bool_to_char(bool b);
int main() {
for (int n = 0; n < 256; n++) {
@HyperPlay
HyperPlay / decimal_to_hexadecimal.cpp
Created August 28, 2019 01:02
Console decimal to hexadecimal converter. (0123456789 to 0123456789ABCDEF)
#include <iostream>
#include <vector>
using std::cin, std::cout, std::endl, std::vector, std::string, std::atoi;
char single_hex(int dec);
bool is_whole_number(string s);
long long get_input();