Skip to content

Commit

Permalink
Added to_string, to_ulong, to_ullong to example
Browse files Browse the repository at this point in the history
  • Loading branch information
pinam45 committed Sep 23, 2024
1 parent afd32dc commit b1a7a98
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions example/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ int main()
// declare bitset with 12 bits from a value
sul::dynamic_bitset<uint32_t> a(12, 0b0100010110111);

// conversion to string with 0 and 1
std::cout << "String representation (0 and 1): " << a.to_string() << std::endl;

// conversion to unsigned long
std::cout << "Numeric value (unsigned long): " << a.to_ulong() << std::endl;

// conversion to unsigned long long
std::cout << "Numeric value (unsigned long long): " << a.to_ullong() << std::endl;

// remove all bits, resize to 0
a.clear();

Expand Down

0 comments on commit b1a7a98

Please sign in to comment.