diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2023-02-20 11:49:42 +0100 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2023-02-20 11:49:42 +0100 |
| commit | e01dae0191e852da8c54f0bd1021d887f1665d29 (patch) | |
| tree | fdc30fc52a9707f03dbb39a3f659da8c18d41018 /datastructures/bitset.cpp | |
| parent | a65b751c69f77f01745f02cdb3ae2548fa86f3ed (diff) | |
added some infos about std::bitset
Diffstat (limited to 'datastructures/bitset.cpp')
| -rw-r--r-- | datastructures/bitset.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/datastructures/bitset.cpp b/datastructures/bitset.cpp new file mode 100644 index 0000000..9f33a5b --- /dev/null +++ b/datastructures/bitset.cpp @@ -0,0 +1,7 @@ +bitset<10> bits(0b000010100); +cout << bits._Find_first() << endl; //2 +cout << bits._Find_next(2) << endl; //4 +cout << bits._Find_next(4) << endl; //10 bzw. N +bits[x] = 1; //not bits.set(x)! +bits[x] = 0; //not bits.reset(x)! +bits[x].flip(); //not bits.flip(x)! |
