Skip to content

Commit

Permalink
Update and rename Convert_to_Binary_String.cpp to bitset.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdompeak authored Nov 21, 2020
1 parent a32d349 commit b2e4dd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion Template/Bit_manipulation/Convert_to_Binary_String.cpp

This file was deleted.

7 changes: 7 additions & 0 deletions Template/Bit_manipulation/bitset.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bitset<100>bs; // define a bitset type

std::string str = std::bitset<32>(n).to_string(); // convert an integer n to bitset type, and then to string type

bs.set(); // make every bit as 1

bs.count(); // count the number of 1-bits in bs

0 comments on commit b2e4dd4

Please sign in to comment.